Projectile spawns next to the player

Hi everyone,

I’m developing a top-down game in Unreal Engine 5.4 and ran into a problem with spawning projectiles using the Gameplay Ability System (GAS).

When I press a key, a gameplay ability is activated that spawns a projectile from the barrel socket of the character’s weapon (using a socket on the skeletal mesh). However, when the character is moving, the projectile appears to spawn noticeably behind or offset from the character’s position.

As shown in the attached video, the first projectile is spawned locally on the client, and the second (delayed) one is spawned by the server. The issue is especially noticeable with the server-spawned projectile—it visibly appears to the side or behind the character, making the whole effect look awkward and unsatisfying.

I suspect this might be due to the character moving quickly while the projectile is relatively slow, so the spawn position lags visually. But I’m not sure if that’s the core issue or if something else is going wrong.

My questions are:

  • Is this offset behavior expected due to the difference in movement speed between the character and the projectile?
  • Is there a good way to correct this (visually or mechanically) without simply increasing the projectile speed or reducing the player speed?
  • Would you consider this a real problem, or is it negligible and I’m overthinking it?
  • Do you have any best practices or suggestions to make this look more polished?

I’d really appreciate any insight or tips. Thanks in advance!

Video showing the issue:

Hey @MyKarcio!

I’m just going to go ahead and answer your direct questions. :slight_smile:

Yup! These would be classified as slow-moving, or at the very least slow-accelerating. Typically this would be fixed by increasing the projectile acceleration or shortening the spawn’s load time.

See above, but personally what I would do is maybe try directly after spawning have the server teleport the projectile to the transform of the rifle muzzle, so once all the hard work is done all it has to do is set a new location. This could be done on both client and server with hopefully a similar output. Another idea is object pooling.

Disclaimer: This link is not associated with Epic Games, Unreal Engine, or their partners.

It depends on how the game plays, really. Hotline Miami? :frowning: Throw the whole game away. Heroes of Hammerwatch? I can work with that! :slight_smile:

See #2 :slight_smile:

Hope this helps!

1 Like