Okay, so I’m making a small tank game, and I need to make my tank shoot bullets, the tank can move, turn, the top of the tank turns on it’s own, with the mouse. Now my problem is, how will I make it so that it looks like the bullet shoots out of the barrel, with the good angle, and position? I’m kind of puzzled.
Share
Easiest solution is to start the bullets from the beginning of the barrel/center of your tank and sort them behind the barrel and tank and fire them the same direction as your barrel is pointed. Requires no special rotation, but causes a slight delay until the bullet appears from behind the tank.
Or, you do some math. Put a hotspot or record the coordinate of the beginning of the barrel and when you rotate the barrel, rotate this point with it. This will then be the new point to spawn your bullets.