Download

Raycasting with a follow camera causes the object to jump left and right

I’ve been playing around in ue4/5 and it’s been great! Loving it coming from unity.

One bug I cannot sort out of the life of me is the raycast issue have with follow camera. I try to place a building based on raycast location from the follow camera gotten from my player.

The player is paragon’s Gideon, and I adjusted the 3rd person follow camera to be a tad off-center to the right (this bug doesn’t happen when the camera is perfect aligned with the actor center). Upon raycast and moving my character, the object/raycast jumps to the left or right depending on the direction I move and then corrects itself.

How can I go about correcting this behavior?

I have uploaded a super short video to see it in action: https://youtu.be/zcAvzO4odsQ

Could you shoud the tracing script?

absolutely!

I believe this the same thing we discussed with @Rev0verDrive recently where the actor’s forward vector is nudged by this:

It’s the second setting that affects how the fwd vector behaves. And since the follow camera is attached to the character via a springarm, it inherits this behaviour. You do need both options as is to get the movement behaviour you’re after. In this very case, it should be enough to change the way you trace.

Try it like so:

As a bonus, you can get rid of casting.


  • using Camera Component for tracing:

  • using Camera Manager for tracing: