bullet goes backwards when aiming up

helloo. why this is happening? when i aim up a bit more bullet going wrong. thx for helps. i spawn my bullet from sockets. i have 2 weapon in my skeleton thats why i do same thing 2 time.

Hi, not sure of your logic here

After you spawn, I see that you are getting the actor forward vector which can be many things. That is not a very good practice, better normalize them first.

Another / better approach on giving velocity to projectile is to pass : DirectionMovementNormalized * SpeedFactor, which would go to desired direction with the speed factor you want (not sure about your other velocity parameters)

However your problem is coming from hit vs not hit traces as I see in video, you are hitting to something, try to start trace from a little bit forward from camera. Try print a hit actor print string name over there if you are hitting capsule, or ground something.

1 Like
I made it so that when I press it once quickly, my bullet will move slower. If I hold it down for about a second, my bullet will fire faster.

yess im trying to print what i hit thank you.

No worries!

I understand the gatling gun feeling you trying to create where you actuate input more fire rate increases.. There is couple of ways to approach that also with other systems or manually.

For manualy I can suggest couple of things

  • Count how many spawns you made since last actuation. RemapRange

  • Another one is to use curves if you have specific behaviour, heat up, environment that effects weapon deployment etc. you can dive into curves.

Happy developing.

2 Likes

wow it says im hitting floor

i didnt get it :frowning:

Hello.

Looking at the code, it looks like the bullet is spawned according to the socket’s transform and fired by applying force to the forward vector. This is a common approach for directed projectiles (like missiles) and I don’t think there’s any problem with it.

What’s concerning is that it appears to have clearly collided with something and changed direction. I’m not sure if it’s the physics body or weapon collision, but please review the collision settings.

Don’t trust Print Strings too much. Returning a collision event is not the same as actually causing a collide.

1 Like

i make camera ray trace 100 forward. now its fixed. i didnt think i hit something before u say :slight_smile:

1 Like

i fixed sir thank your help too