YouGroove Posted March 19, 2013 Posted March 19, 2013 i have a script : simpleMov.lua this function function Script:placeProjectile() local targetpos = self.entity:GetPosition(false) model:SetPosition(targetpos.x,targetpos.y,targetpos.z) end And i would want ot call it from updatePhysics method. function Script:UpdatePhysics() ... self.entity:SetInput(0,move,strafe) if window:KeyDown(Key.Space) then simplemov:placeProjectile(entity.goblinai) end end But it don't work ? Someone know how to call the function ? Sadly on AI.lua, Player.lua, there is only callbacks, not direct calls as this one i want to do Quote Stop toying and make games
YouGroove Posted March 19, 2013 Author Posted March 19, 2013 Found it, in fact the error was comming from parameters. To call it , just use self (that means this script like Java where you can use the keyword "this") self:placeProjectile() Quote Stop toying and make games
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.