Camera trace slightly innacurate

I think I found the “problem”, which might be an error on your part. You didn’t set the “ServerFireAuto” event as “Run on Server”

I believe this should be set to “Run on Server”, because otherwise you’re RPC-ing the server for every bullet (which as we talked about is not good :sweat_smile: )

When I set this event to “Run on Server”, then it stops working in your project

No it’s intended to work on both client and server. The server fire is server specific.

If you want the loop 100% on server try this:

Hm… this won’t work because nothing is breaking the loop… The check for “IsFiring” is done before you start the loop, but when inside the server loop, it will just go on and on because there is no checks that stop it.


OK updated. Missed that detail.

Thanks, that works!

1 Like

Camera manager works on the server for getting client camera location.

1 Like

Good to know. It’s usually simpler to access.

I have a function that’s called for every shot to set projectile trajectory. I have client version and a server version.

Both versions start off setting local vars for forward vector, camera location etc.

Once the Trace select vector is defined I can set the Aim Vector and Aim Velocity.

Aim Vector is a direction which starts at the muzzle and points toward the trace select vector location.

Aim velocity is the Aim vector with speed applied. If using Projectile Movement Component you’d pass the Aim Velocity to the projectile class and set PMC → Velocity to this value.

She’ll fly after that. Directly to target.

1 Like

For visual clarity

When you apply speed (float) to the Aim Vector it will result in the projectile taking the purple line trajectory.

When aiming down sight (ADS) the camera used in my setup is one that’s attached to the weapon itself. When the client applies ADS I use Set view target with blend to switch cameras.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.