Prevent linetrace from shaking when camera moves?

Hi, I call LinetracebyChannel in tick to detect actors. I have a camera in the vehicle class. And the range of Linetrace is based on the WorldLocation of the camera. When vehicle runs, the camera moves with it. At this time the line shakes because of the calculation of camera’s world position. I know there are may have some advanced methods in latest versions, how to make the line stable in version 4.11?

It should not shake unless the camera is shaking. It should only point where the camera is pointing. Also, that GetForwardVector is not necessary just plug the GetWorldRotation directly to the x3000.

I chose “Draw Debug Type” to “for one frame” and print the vector of camera. I found vector of camera did’t change at all. However, the red line shakes when vehicle moves. I set another camera to watch the camera emitting a line and the lines shakes indeed.

128440-2.png

I did this, and my camera didn’t shake.

Try to get Forward Vector directly from camera, not from rotation.(I did circle around myself :))

Hi, the shaking condition is move the camera(change the location, not the rotation). I will try your method tomorrow and u can also try to change the location of the camera and watch the line movement.

I changed location and rotation.