Physic "Stick" Constraint

GLPhysx
Posts: 14
Joined: Sat Nov 28, 2009 11:28 pm

Physic "Stick" Constraint

Post by GLPhysx »

I would like to add into my game that the player can stick on some surface... In example you have a sphere and when the character jump on it it can "stick" around this sphere (can now walk 360 around it, like in mario galaxy).

I try to search on google and on this forum about this but I haven't found anything relevant. Probably Im searching the wrong keywords...

What I would like to know is which "technique" should be use to achieve this kind of effect?

Thank,
GLPhysx
Posts: 14
Joined: Sat Nov 28, 2009 11:28 pm

Re: Physic "Stick" Constraint

Post by GLPhysx »

Would a constraint will do? If yes which one?
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Physic "Stick" Constraint

Post by Flix »

GLPhysx wrote:In example you have a sphere and when the character jump on it it can "stick" around this sphere (can now walk 360 around it)
Maybe you can trying setting the character gravity at each internal timestep so that it is directed towards the center of the sphere (without using any constraint). But most likely you will need a constraint to make the character Y direction aligned with it.

Maybe locking an angular degree of freedom (by using a the generic dof6 constraint) could work, but you need to update the angle each internal timestep.

I really don't know what I'd do in this scenario... my suggestion is just to try something and see if it works!
GLPhysx
Posts: 14
Joined: Sat Nov 28, 2009 11:28 pm

Re: Physic "Stick" Constraint

Post by GLPhysx »

Got it tks!

Will keep you posted ;)