- Home /
Question by
Marcel_Eissens · Nov 28, 2016 at 08:05 AM ·
2drigidbody2dprojectileprediction
Tank AI, 2d rigidbody projectile trajectory prediction
Hello,
I'm making a 2d tank game and I'm struggling with AI.
The AI tank needs to adjust its barrel angle so that it hits the player(wich has the abbility to move). I have tried various things, but none of them worked correctly.
The problem is that the playground isn't a flat surface, so a calculation like
barrelAngle = distance / 0.18f; wouldn't work
(0,18 is the barrel angle i got after testing various distances and the barrel angle it had when it hit the target)
[EDIT] What I want to achieve is basically predict the path the projectile (rigidbody2d) will follow, and if it's landing point is the player, then execute a method called Fire.
Can anybody help me with this?
Best regards,
Marcel
Comment