tjheldna Posted December 15, 2013 Share Posted December 15, 2013 Im trying to create a moving platform between two points and need the player move with the platform. This interpolates the platform between the points nicely Vec3 lastPosition; lastPosition.x = Math::Lerp(current->GetPosition().x, finish->GetPosition().x, smoothness / Time::GetSpeed()); lastPosition.y = Math::Lerp(current->GetPosition().y, finish->GetPosition().y, smoothness / Time::GetSpeed()); lastPosition.z = Math::Lerp(current->GetPosition().z, finish->GetPosition().z, smoothness / Time::GetSpeed()); current->SetPosition(lastPosition.x, lastPosition.y, lastPosition.z); Currently Iv'e created a platform which sinks into the ground however when the character controller jumps on it, he does not sink with the platform until I move him, so maybe the physics on the character is sleeping or something. Also he does not move with the platform as it moves from side to side. Am I doing something wrong in the way I have created this 'Mover Object'? Am I supposed to use a Slider Joint? Not too sure. Thanks all! Quote Link to comment Share on other sites More sharing options...
Rick Posted December 15, 2013 Share Posted December 15, 2013 Are you using LE's physics for this? If so don't you have to use the physics set position on the platform? http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entityphysicssetposition-r190 As I recall, setting the position like you are, on a physics shape, disabled it's physics. Also have a look at http://www.leadwerks.com/werkspace/files/file/434-elevator/ 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted December 15, 2013 Share Posted December 15, 2013 I use a motorized slider joint for moving platforms. (You can release the joint and create a new one when the waypoints change.) One of the tutorials in 3.1 is on this, actually. 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...
tjheldna Posted December 15, 2013 Author Share Posted December 15, 2013 Thanks guys, I'm just a little worried with the physics as this platform in particular needs to go though the terrain ( its a collapsing structure). Anyway I'll look into each suggestion today and see what works. Cheers! Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 15, 2013 Share Posted December 15, 2013 You could give it a different collision type than the terrain. 1 Quote Link to comment Share on other sites More sharing options...
tjheldna Posted December 16, 2013 Author Share Posted December 16, 2013 Just did a massive internal fist pump as I just got it all working exactly as I wanted it. Thanks heaps guys. 1 Quote 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.