Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: chautran on August 13, 2015, 12:11:46 PM

Title: How do I get Vector3 direction?[solved]
Post by: chautran 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!
Title: Re: How do I get Vector3 direction?
Post by: jeanfabre 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 (https://hutonggames.fogbugz.com/default.asp?W1181).

Bye,

 Jean
Title: Re: How do I get Vector3 direction?
Post by: chautran on August 17, 2015, 01:55:57 PM
Thanks! I get it now.