So far, my project is working well. But there is an obvious bug in the rotation.
When the hit result is within bound(visible objects), the rotation performs well.
When there isn’t a hit result and the cursor is out of bounds, the rotation just doesn’t work.
In the second picture, the cursor I believe is on the sky and that results in the wrong rotation.
This bug gets worse when I remove the debug sphere because I have no idea where that cursor is, and a lot of weird rotation will appear.
Any thoughts on how to fix this bug? The easiest way that I am thinking now is using static meshes to cover the surrounding so that the cursor would always hit something. Is there a fix in coding? Maybe change the ECC::Visibility to something else?