Help needed with tank game!

I am about to make a tank game, but first i started test the things i would need to know before making envoirement and so on.

Every thing had worked fine until now :). I have got the tank shooting but i have a problem.

When the tank (or the thing on the top with the canon), are rotated about 90 degrees, it wouldn´t shoot straight forward any more.:frowning:

Why? and how could i solve it:confused:??

You control the tank with A,S,D,W and control the thing on the top with Q and E. You shoot with the left CTRL button.
The shooting is made with the empty object, and the bullet is in layer two.

Here is the .blend file!

Thank for you help!!


  • You forgot to pack your textures, so we can’t see them. Pack them by doing “File->Pack Data”.
  • Your game crashes blender for some reason. I don’t know why exactly, but I get a bunch of “image errors” and then a seg-fault. Could be related to the fact that you forgot to pack, but that never usually spawns errors such as these, so I think it could be something more. Link to a .blend with packed data, so that I (or anyone else) could test that theory. (it could be a Linux specific thing, but I doubt it).
  • Since your game crashes on my machine I couldn’t see your problem in action, but I looked at the logic setup, and I think I found a solution. -> Don’t move your “bullet” with a motion actuator, you should use that “add object” actuator to apply force. Also you should enable “local transformation” (that little “[L]” to the right of the forces), so that your bullet will “shoot” in the same direction regardless of tank rotation.

I got the same problem before and it might be because of the use of .png image file,
for me, when player in blender it dont crash but if we make a runtime file, then the runtime cant read the png, but instead of just not showing it it crashes

It doesn´t work even with the force applyed by the “add object” actuator.

Sorry that i forgot to pack the textures!!

Here it is with the textures packed!

Maybee it help with the crashing problem now!

I’ve had this problem before too. Maybe this will help:

EDIT: Q and E to rotate turret. space to shoot.

Hello i have found the problem!! When the empty object there is turning the “gun/ the thing on the top of the tank” isn´t parented to anything it is working just fine. But if i parent the object there is controling the turning to another object it doesn´t work.

My problem is now that i can´t get the thing on the top to drive with the tank, exept there is another way to parent. Or just something to get the thing on the top to follow the tank!!

Do anyone have a solution??

if you guys add .PNG files you need to include the zlib.DLL with your game.

some controls will require you to use SDL.dll

unparent your Objects, and press control A to each of them to fix funky rotation.