Hi,
I'm having some issues developing spaceship shooting AI that can accurately fire and lead its target.
Currently I'm aiming using Look At, and I'm looking at the target's position + velocity. I've also adjusted for the bullet speed and my distance from the target, and I believe I also need to somehow account for the frame rate(?). I have implemented this, but its still not perfect. There's probably some other things I need to account for as well.
I have two issues to resolve:
1. I'm using Look At to ensure I'm aiming exactly where I want. This mostly works, however I'd like to use Smooth Look At to give the space ship a more realistic turning speed. How would I adjust for this? At the moment, using it just gives me a lagged effect where I'll constantly shoot behind my target. Alternatively, would Vector3 Rotate Towards (somehow) work better? I'm kind of unsure how that's used.
2. DeltaTime. I've read that for leading targets, you need to account for the movement into the next frame by using some sort of framerate time/FPS numbers, however when I use DeltaTime, I'm returning 0. I'm using a turn based system and pausing/unpausing, and figure this is the problem somehow?
Thanks for any help!
Regards,
Jay