Any thoughts on how to debug this rotation problem?

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.
image

When there isn’t a hit result and the cursor is out of bounds, the rotation just doesn’t work.
image

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?

1 Like

GetHitResultUnderCursor returns a bool as to whether it hit something. Simply not doing anything if there was no hit should solve the problem.

Brilliant! Problem solved

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms