Playmaker Forum

PlayMaker News => General Discussion => Topic started by: Nils Anderssen on June 02, 2014, 10:46:48 AM

Title: Angle to a target
Post by: Nils Anderssen on June 02, 2014, 10: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 (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 :)

Title: Re: Angle to a target
Post by: Richard_M1 on January 08, 2015, 03: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.