playMaker

Author Topic: Angle to a target  (Read 1226 times)

Nils Anderssen

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Angle to a target
« on: June 02, 2014, 07:46:48 AM »
Hi,

I am trying to set up a FSM that can determine if an gameobject is left, right, front or back to another gameobject, but have been able to do this successfully.

I have tried to use the "Get Angle To Target" script that is already in Playmaker, but it only gives me the angle with the shortest route from the front of the object, so I have no idea if it is left or right.

Is there any other way I can do this?

I have tried to install this script, but Unity crashes on load if I do so:
http://hutonggames.com/playmakerforum/index.php?topic=3027.msg13819#msg13819

I guess it is not hard to do this, but atm. I am out of clues. Thanks to those who take the time to answer :)


Richard_M1

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Angle to a target
« Reply #1 on: January 08, 2015, 01:01:42 PM »
I used the code to the post you linked and it worked well for me, just gotta fix the comment error on the first line and make sure to use the same name for the file as the script.