Projectile from Tank not moving

This was a strange bug. The Turret spawns the projectile as expected and it travels towards the tank, again as expected. The Tank spawns the projectile when the mouse pressed (Fire event) as expected but does not travel towards the turret. It just stays at its initial spawn point in front of the turret. The tank moves and rotates as expected.

As the projectile code is all in the ProjectileBase I would have expected the same behavior in the derived Turret and Tank classes. A difference is how the Fire event is acted upon. Tank is via a player input event and the Turret is via a timer event.

I eventually found the issue - The spawn point must have been too close to the turret so when it spawned it collided with the turret and therefore the physics stopped its movement. I moved the spawn point further away from the turret and it worked.

Problem solved. :slight_smile:

PS. I wrote this post before the end of the video and Rob had the same problem but with the turret and not the tank. Anyway, it was a good learning experience to think through the possible causes.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms