Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: sleepywolf on February 20, 2018, 10:05:56 AM

Title: problem on transform.rotation[SOLVED]
Post by: sleepywolf on February 20, 2018, 10:05:56 AM
Hi there,

I am working on an IK system for my game character.  I totally rely on Playmaker for the programming part since I know little about c#.  I find a line of code which is useful for me, however, I don't know how to translate it to playmaker flow.   

Rotation = Quaternion.FromToRotation(transform.up, RaycastHit.normal) * transform.rotation;

"Rotation" is a vector 3 variable for rotation of the ik effector for the foot of my game character.  "RaycastHit" is the Store Hit Normal result in Raycast.  I can find the action "Get Quaternion From Rotation" and I know how it works.  I don't understand is the "transform.rotation" part.  I don't know how to translate it into playmaker flow chart since I don't understand what "transform.rotation" here refers to.  Anyone can help?


 
Title: Re: problem on transform.rotation
Post by: jeanfabre on February 21, 2018, 01:26:22 AM
Hi,

 Transform.rotation is accessed using the action "GetRotation" and you save the quaternion part of the result of that action, not the euler angles.

and to multiply quaternions, use the action "GetQuaternionMultipliedByQuaternion"

Bye,

 Jean
Title: Re: problem on transform.rotation
Post by: sleepywolf on February 21, 2018, 08:38:13 AM
Got it!  Thanks Jean!