playMaker

Author Topic: problem on transform.rotation[SOLVED]  (Read 1337 times)

sleepywolf

  • Playmaker Newbie
  • *
  • Posts: 2
problem on transform.rotation[SOLVED]
« 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?


 
« Last Edit: February 22, 2018, 01:23:56 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: problem on transform.rotation
« Reply #1 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

sleepywolf

  • Playmaker Newbie
  • *
  • Posts: 2
Re: problem on transform.rotation
« Reply #2 on: February 21, 2018, 08:38:13 AM »
Got it!  Thanks Jean!