Projectiles Shaking on client side

Hey, I’m currently using UE5 5.3 and I have a problem with projectiles.

When a create a new sphere actor, add a projectile movement, set the gravity to 0 and I try to spawn it with a custom event set on the server, the spawned projectiles move like it should, but keeps shaking for no reason. It only happens when I play on the client side. I even tried to make a new project to see if that was the problem, but no it those it either way.

Any help would be really appreciated.

Hey @Maybe_KaPoun1 , welcome to the forum!

ProjectileMovementComponent uses physics to work. Physics are tricky cause each client calculates their own, that’s not (or shouldn’t be) replicated.

Anything using physics can often cause shaking or stuttering on the client side, so be very careful with replicating movement, replication rate and so on.

Actors with physics usually require a lot of fine tunning to avoid these issues.

You can also play with Client side error correction, but I would suggest moving the actor rather than using projectile if you don’t need gravity.

PMC by default doesn’t use physics. It moves a component on Tick().
If you tick “Simulate Physics” then PMC will initially launch the projectile with provided velocity and then let the physics sim take over. No other PMC functionality will be applied. It effectively disables PMC.

image


@Maybe_KaPoun1

Each Proxy should be firing it’s own local projectile. Create a base projectile class for each.
Client, Server, and Sim.

When the client inputs fire spawn the local client projectile and fx. Let the clients projectile handle “local” impact fx.

On Fire client RPC’s server to fire. Server fires its local “Authoritative, Non-Replicating” projectile. This projectile will handle hit detection and dmg.

When the server fires have it Multicast its velocity vector to Sims. Use get remote role == simulated proxy to only allow sims to execute the multicast logic.

Sims use the passed vector to fire their local only Sim projectile if you need them to. Otherwise you can have them fire, but not spawn the projectile. I have mine do so because my sim projectile has an audio component used for flyby whizzing of bullets.

If you don’t spawn a sim projectile you can have the servers projectile call a multicast to pass hit location, normal, phys mat etc for sim proxy hit impact fx (squibs, sound, decals).