Hi, I’m a beginner in Unreal and would like to ask for your help.
I’m trying to create an effect similar to an iPhone LiDAR sensor using Line Trace Matrix.
Initially, the program obtains the forward vector of the camera and then rotates the vector to the upper-left position of the Line Trace Matrix. (The red dot in the middle represents the forward vector of the camera.)Subsequently, it starts scanning from left to right and from top to bottom.
The program works perfectly when the player is facing angles other than 90 degrees and -90 degrees.You can see that the yellow scan points form a correctly shaped square region.
However, when facing 90 degrees and -90 degrees, errors in the displacement of Line Trace start to occur, and the matrix is no longer square.
Initially, I thought there was a problem with my rotation program. However, when I switched to a 360-degree scan, the circular scan lines appeared normally when facing angles other than 90 degrees. But when facing 90 degrees, all the scan lines in the scene were in an incorrect overlapping state.
The following is my program.
I’ve tried all the methods I could think of, but still can’t solve it. If you need any other information, please let me know. Thank you for your assistance.