Question by
CobbledGames · Dec 13, 2019 at 03:20 PM ·
c#anglevector2
Move a game object away from another game object based on the angle difference
I would like to know how I can make a gameobject move away from another gameobject where the direction is based off the angle difference that the moving game object has compared to the game object it is moving from.
simply using move towards * -1 would be ineffective as the target object has to always be present for that to work.
Comment
Answer by CobbledGames · Dec 16, 2019 at 02:22 PM
Nevermind I've found it out. It involves first getting the angle and then applying it's cosine and sine to a vector's X and Y component respectively.