I don’t quite understand that…
If you take a look at this little sketch:
How do I get the rotation of my gun right so it actually aims at the target.
I’m working on a 2D top down shooter prototype, and I’m wondering how this is usually solved?
Do you just spawn the projectile directly in front of the character and take the forward vector?
Do you rotate the gun (or the whole character) so the gun actually points at the target (which would cause constant rotation whenever you aim at different distances)?
Or would you just spawn the projectile at the guns muzzle, leaving the guns actual rotation, and just use some LookAt rotation to a line trace HitResult (which might end up looking weird, cause the gun doesn’t really fire where it’s pointing)?
For the 2D project it might not be that big of a problem, but how would that be for first person shooters or AI, especially?
I also worked on a 3D tower defense with gunmen instead of towers. I kind of ran into the same problem… my units looked at the enemy but missed each shot because their gun wasn’t pointing at their target.
Is that what AimOffset is there for or is that just for animation?
Thanks in advance!