playMaker

Author Topic: How do I get Vector3 direction?[solved]  (Read 1951 times)

chautran

  • Playmaker Newbie
  • *
  • Posts: 2
How do I get Vector3 direction?[solved]
« on: August 13, 2015, 12:11:46 PM »
Hello guys,

I need to get a vector3 direction from one game object to another but I don't know how. In scripting I can subtract the target position the original position, but playmaker doesn't have anything like that.

Can anyone help? I appreciate it!
« Last Edit: August 17, 2015, 10:45:56 PM by chautran »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do I get Vector3 direction?
« Reply #1 on: August 15, 2015, 05:45:35 PM »
Hi,

 use Vector3Operator action, it has a "substract" operator. Get the position of your target and source as VEctor3, and then you'll have your direction.

 If you want a direction as a Rotation/Quaternion, use QuaternionLookAt action from the Ecosystem.

Bye,

 Jean

chautran

  • Playmaker Newbie
  • *
  • Posts: 2
Re: How do I get Vector3 direction?
« Reply #2 on: August 17, 2015, 01:55:57 PM »
Thanks! I get it now.