I've had a search and can't really find this anywhere, so I've come to pick everyone's brains. Please feel free to reply with the obvious link I missed :P
What I'd like is for AI players (using car behaviour) to be constantly steering towards the player-character when aggro'd. In order to do this I figure I'll calculate the angle between the AI and the enemy player, and if it's outside a certain range then begin steering, and if it's within a certain range then start accelerating again. I was hoping the behaviour would look something like a fly buzzing around a ham. Unfortunately what I've got so far doesn't seem to be working:
Angle(AI.X, AI.Y, PC.X, PC.Y)
Which seems to give the relative angle between the AI and the PC, but not taking into account the direction in which the AI is facing... does anyone know of any solutions?
- Mr Tumbles