LineTraceByChannel and GetHitResultUnderCursorByChannel gives different results
I'm trying to do some raycasting in a networked project. However I have an inaccuracy issue that I can't manage to solve.
So here are my steps:
However, it's not accurate compared to the GetHitResultUnderCursorByChannel build-in function. I use it like this and it works perfectly.
Please take a look at the results screenshot. In RED the results of my custom raycasting. In BLUE the result of the build-in raycasting. What is wrong here ?
Thanks for reading, best regards.
I found the issue ! I'm stupid though haha but thanks to my previous post here and @Mhousse1247 advice, I checked the PlayerController.cpp C++ code and found out that GetHitResultUnderCursorByChannel is throwing the ray 100.000cm away from the start point, while I was throwing it 20.000cm away. This explains the small difference between the results !
Have fun with UE4 <3
answered Nov 24 '16 at 12:54 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here