Character movement effected by environment movement

Hello everyone! This is my first post and I’m somewhat new to Unity. A group of us are doing a quick prototype project and we’ve run into a bind.

Our level is a 3rd person platformer type, and consists of the player character jumping on gears that are rotating. The problem is that the character does not move with the gears as they rotate. i.e. the character is stationary as the gear continues to rotate below him.

Are we missing something? We’ve tried animating in maya and exporting the gears to unity, and also importing a non-animated gear and using a constant force. Neither seem to work. Also, we are using the 3rd-person controller script from the lerps tutorial.

Any help or ideas would be welcome, and greatly appreciated!

(make sure your gear asset has generate colliders checked!)

Add to your gear:

Component->Physics->RigidBody

then make sure “Is Kinematic” is checked in the RigidBody component. A kinematic body in physics engines are supposed to act as a juggernaut which you can manually program how they move.

Not enough experience to tell you how it works in unity… But from experience with other physics engines, you’ll probably want to control it with a script instead of animating it and if you still can’t get the thing working try dropping a few (non-kinematic) rigidbodies ontop and see if it does something!

Thanks for the reply!
It seems that all of the things I’ve tried aren’t working out.
Should I have to script it, any idea where I should start?

edit: It did work though if I just make a primitive and give it rigid body physics. It seems that the “character controller” is what makes it stop acting the way that I want it to.

Do your gears have concave or convex colliders? I never remember which one but one of them won’t allow indentations. Just a thought.

I’m not sure. I just checked “generate colliders” in Unity.

Hm, in that case I think the problem comes from the character controller technically being a kinematic body itself!

There is no correct way to make a character move in a game, so my best guess is you can just use a rigid body. With Freeze Rotation checked you should be able to add to linear velocity like you would use CharacterController.Move().