TheKkubas Posted September 19, 2015 Share Posted September 19, 2015 Hi! When I used Entity:Move child entities of model wont work. 3D model is moving but Leadwerks stuff like pivots, cameras etc. won't move. I discovered it on that script: Script.object = "" --entity "Starship" Script.pivot = "" --entity "CameraPos" Script.uppoint = "" --entity "FowardPivot" Script.backpoint = "" --entity "BackPivot" Script.camera = "" --entity "Camera" function Script:Start() end function Script:UpdateWorld() objectrot = Vec3() if window:KeyDown(Key.W) then self.object:Move(self.uppoint:GetPosition()) end if window:KeyDown(Key.A) then local oldrotation = Vec3() local newrotation = Vec3() oldrotation = self.object:GetRotation() newrotation = oldrotation+Vec3(0,0,0.7) self.object:SetRotation(newrotation) objectrot = newrotation end if window:KeyDown(Key.D) then local oldrotation = Vec3() local newrotation = Vec3() oldrotation = self.object:GetRotation() newrotation = oldrotation+Vec3(0,0,-0.7) self.object:SetRotation(newrotation) objectrot = newrotation end end The Script.uppoint = "" --entity "FowardPivot" is a child of Script.object = "" --entity "Starship" . When i try to move with "W" pivot should go with spaceship but it won't. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 20, 2015 Share Posted September 20, 2015 This is a very strange line of code: self.object:Move(self.uppoint:GetPosition()) If the child's position happens to be 0,0,0, no movement will occur. In any case I think the Move command does not work the way you are picturing: http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitymove-r165 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
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.