[SOLVED] When I shoot my gun the player entity is flying off the map

editor: PlayCanvas | HTML5 Game Engine

and when you fall of, and try to look around, my gun starts vibrating

Hi @Thebosser.24 and welcome back! In your scene the bullet is a child of an entity that has a scale of 0.3. When you add a new bullet and make it a part of the root entity, the parent of the bullet has a scale of 1.0. As a result the bullet is much bigger and this effect the rigidbody of the player. To solve this, you can rescale the bullet after you have add it as a child by script. I suggest to temporary add a visual model to your bullet and try to set the correct scale by script.

bullet.setLocalScale(0.01, 0.01, 0.01);
1 Like

I just got a bullet model, and I will definitely try that out

@Albertos so, I made the parent of the bullet all (1,1,1), and the bullet down super small, because the model is really large (mistake on my end) so the bullet size is 0.001 on all axises
the bullet doesn’t shoot.

also, note that I had to rotate the bullet 270° so it will face forward.

I checked the code and I didn’t see any errors

If I enable the pistol with the 1 key, shooting works for me.

You only need to change the axis, to move it in the right direction.


1 Like

Thank you! I have figured out how to make the bullet shoot straight

1 Like