playMaker

Author Topic: Direction vector between to objects  (Read 2700 times)

mathius777

  • Playmaker Newbie
  • *
  • Posts: 38
Direction vector between to objects
« on: July 21, 2013, 05:51:27 PM »
I have a cannon, and an object at the tip of the cannon. I want to get the direction vector between the tip of the cannon and the center of the cannon, so that I have the direction vector to shoot bullets out of the cannon tip. I cannot find any actions that would allow me to do this? How would I go about getting this vector? Thank you.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Direction vector between to objects
« Reply #1 on: July 28, 2013, 05:35:11 PM »
Hi,

 simply use the canon transform ( assuming that gameobject as its axis properly aligned with the canon). and then use "Transform direction" action and choose the right axis, this will give you the the direction of your canon.

bye,

 Jean