Jump to content

Recommended Posts

Posted

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!

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Posted

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.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

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!

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...