Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Muminka on September 11, 2013, 11:50:54 AM

Title: problems with rotating an object depending on surface [SOLVED]
Post by: Muminka on September 11, 2013, 11:50:54 AM
Hi guys,

Here is what I try to reach:
I have a butterfly which shall be rotated relative to the surface it sits on.
I used this solution: http://hutonggames.com/playmakerforum/index.php?topic=3510.0
but this does not work properly for my situation as the butterfly looks in the same direction as the surface normal. (If it sits for example on the top of a cube, it looks up in the sky.) Rotating it afterwards, as in another thread was suggested for footsteps also does not work because it can lead to the butterfly lying on it's back in the end.

I think this solution http://answers.unity3d.com/questions/528078/how-do-i-rotate-a-rigidbody-to-a-surface-normal-an.html could fit, but it uses Quaternion.FromToRotation and I could not find an equivalent in playmaker. Did I oversee something or is there perhaps a super easy solution I did not find yet?

Greetings
Muminka
Title: Re: problems with rotating an object depending on surface
Post by: jeanfabre on September 13, 2013, 05:36:46 AM
Hi,

 have you checked this:

https://hutonggames.fogbugz.com/default.asp?W967

 bye,

 Jean
Title: Re: problems with rotating an object depending on surface
Post by: Muminka on September 13, 2013, 09:09:42 AM
Oh thank you very much, this was exactly what I needed  ;D