Game Editor- FPS Gun Animation

So, I’m new to the blender GE. I’ve been looking at many tutorials, and I’ve seemed to run into a bit of a problem. I’ve been working on the gun physics for the past while, and I’ve made my gun able to shoot. After that, I’ve started to create a working gun animation. I’m trying to add my animation to the logic editor, but nothing seems to work. If anyone knows how to get this working, it would be greatly appreciated. My gun logic is located in the empty, and the bullet. Thanks!

Game_Copy.blend (1.17 MB)

The first problem that I see with it , is that , when you right click and select the gun , there needs to be an animation action on it. It has no action on the gun. You have to put the action/animation on the gun first. You can also see that the animation system is not able to keep up with the firing rate. Most modern games use procedural animation. They don’t use key frames much.

Attachments

Game_Copy 001.blend (405 KB)

Ok, thank you so much. I just have another question. After the first bullet shot, the bullet seems to not fire anymore, or it isnt appearing. Do you know why that is? Thanks!

That’s a parenting bug and you have to delete the animation clip from the empty and try to clear rotation/scale/location on it too. Try to use a visible mesh instead of an empty because the mesh can be set to visible/invisible and you can see if it flips or not. Second problem is the parenting bug. The bullet is supposed to ad it’s own velocity to the launcher/parent. It’s not doing it. You need to script it so that the final speed of the bullet is something like ( bulletFinalSpeed = parentSpeed + bulletSpeed ). You can see it in this example. If you move , the player is overtaking the bullet.

Attachments

FPS Test 001.blend (1.99 MB)

Here is an updated version but the bullets still look wrong when player is moving or rotating.

Attachments

FPS Test 002.blend (1.75 MB)

With the physics engine turned off the trajectory of the bullet is more correct. As soon as you turn on the physics engine the bullet gets delayed by one frame and the path it’s taking looks wrong even at 120 fps.

So, I’ve been working on it, and I’ve run into a new problem. I got the gun and bullets to work, and I added aiming logic. I had to add a cube to work as the mouselook, because the parenting wouldn’t let me move the camera for aiming. Whenever the cube moves, the character either glitches or moves the wrong way. Why does it do that?

is something not no collision that should be?

is something parented to the cube?