DooMAGE Posted July 21, 2016 Share Posted July 21, 2016 Hello friends, I'm doing some tests for the summer contest. In my game I have a platform that moves foward indefinitely, the problem is that when the player is on the platform the platform over time starts moving to other directions, I guess it's because the physics and the player mass above the platform. How I can constraint the movement of the platform to always be locked to one axis? I'm using this: function Script:UpdatePhysics() self.entity:SetVelocity(0,0,2, true) end Quote My Leadwerks games! https://ragingmages.itch.io/ Link to comment Share on other sites More sharing options...
thehankinator Posted July 21, 2016 Share Posted July 21, 2016 Have you looked at this yet? http://www.leadwerks.com/werkspace/page/viewitem?fileid=641192226 Quote Link to comment Share on other sites More sharing options...
DooMAGE Posted July 21, 2016 Author Share Posted July 21, 2016 Have you looked at this yet? http://www.leadwerks.com/werkspace/page/viewitem?fileid=641192226 Not yet, maybe this can be used to a 3D game too? I think I fixed the problem, but I don't know why or how it works. I used something called Joint::Slider function Script:Start() self.entity:SetCollisionType(Collision.Scene) local position=self.entity:GetPosition(true) self.joint=Joint:Slider(position.x,position.y,position.z,0,0,0,self.entity,nil) end function Script:UpdatePhysics() self.entity:SetVelocity(0,0,2, true) end Quote My Leadwerks games! https://ragingmages.itch.io/ Link to comment Share on other sites More sharing options...
Josh Posted July 21, 2016 Share Posted July 21, 2016 http://www.leadwerks.com/werkspace/page/api-reference/_/joint/jointslider-r737 http://www.leadwerks.com/werkspace/page/api-reference/_/joint/jointsetlimits-r796 http://www.leadwerks.com/werkspace/page/api-reference/_/joint/jointenablelimits-r793 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...
DooMAGE Posted July 21, 2016 Author Share Posted July 21, 2016 The api reference is always opened here To solve this problem I used Joint::Slider right? or should I use Joint::SetLimits and Joint::EnableLimits too? Quote My Leadwerks games! https://ragingmages.itch.io/ Link to comment Share on other sites More sharing options...
Josh Posted July 21, 2016 Share Posted July 21, 2016 The limits will keep it from moving beyond a certain range, if that is what you want. You can also use the motor feature to move the joint. 1 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.