How do I make my character "stick" to a moving platform?

Hey there,

I’m just starting on Blender actually and I’m loving it, very powerful software. But I’m still quite the noob.

The question I have and I’m sure is quite simple to answer: In a side scroller scenario, how to I make my character move with a platform that is moving back and forth (left and right, technically)?

My character’s physics type is dynamic and the moving platform is rigid body, just to let anyone know in case I need to change that.

I’m not sure what to call this type of physics interaction. I thought friction would be my answer but I couldn’t get that to work.

Thanks,
rusty

You can set a higher friction value for the platform material, in the material settings, and that should basically work.

However, even then, a sudden change in direction will induce a bit of sliding, so you might want to change direction in gradual manner (slow the platform down to a stop, then move in the opposite direction).

There are other solutions as well, but they’re not as “clean”.

Example of the basic friction set-up is attached - hope it helps:

Attachments

friction.blend (412 KB)

Sweet, thanks a lot!

It’s pretty buggy though. About half the time when I jump on and don’t stop moving when I land then stop, I get shoved off and it’s all jerky.

Is that something that can be fixed with tweaking settings or can I get a more robust control over it with a Python script? (I know a good deal of Python)

Sure.

I mean, you have access to the position of the game object via the worldPosition vector, so you can set it relative to the platform.

Although, in most cases, I think the gradual slowdown strategy tends to work pretty well.

Did you try that yet?

Yup, slowing it down makes it better. Thanks man, I really appreciate it!