Making a character controller “stick” on a moving platform?

Software: Away3D 4.x

Alex Bogartz, Sr. Member
Posted: 07 October 2011 01:08 AM   Total Posts: 216

I have a cube being moved by a physics constraint as though it were a piston.  When I jump my character on top of it, when the cube moves away, the character doesn’t move with it.  Is there a way to make him have “friction” so he moves with the ground beneath him?

   

Richard Olsson, Administrator
Posted: 07 October 2011 02:53 AM   Total Posts: 1192   [ # 1 ]

Does it not work to simply set the friction property on each of the rigid bodies to anything other than zero?

   

Alex Bogartz, Sr. Member
Posted: 07 October 2011 03:26 AM   Total Posts: 216   [ # 2 ]

No, that seems to have no effect.

   

John Brookes, Moderator
Posted: 07 October 2011 12:49 PM   Total Posts: 732   [ # 3 ]

I read somewhere on the bullet forum, the accepted method was to update the character with the platform position.

   

Alex Bogartz, Sr. Member
Posted: 07 October 2011 02:05 PM   Total Posts: 216   [ # 4 ]

Do you have some hints about how that’s accomplished?  The character controller is a little quirky.  I think I need to apply force to it perhaps?  I’m not at my computer right now to test, so any tips would be appreciated.

   

John Brookes, Moderator
Posted: 07 October 2011 03:50 PM   Total Posts: 732   [ # 5 ]

Yeah, never seen the usefull bit about how smile)

Not really tried anything more than
if (onPlatform)
character.warp(new Vector3D(platformRb.position.x , character.ghostObject.position.y, character.ghostObject.position.z) );

   

Alex Bogartz, Sr. Member
Posted: 08 October 2011 01:47 AM   Total Posts: 216   [ # 6 ]

Quick update, that sort of works, but I need to figure out the initial X offset and to handle the character walking. If you keep setting the X value he doesn’t walk left or right on the moving platform, which is obviously not correct.  It’s trickier than it sounds!  But it’s Friday, so it’ll have to wait.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X