The infinite plane is defined by a point (origin) and a normal (in my case it is horizontal so the normal points up)
The ray is actually a line form the camera to the mouse position multiplied by the trace distance. Keep your trace distance reasonably large depending on how far you think you might be from the plane.
The point is automatically calculated and a debug sphere is shown there.
Hi.
I know how to make an FPlane. But I don’t know which normal to choose. How can I rotate the FPlane so that it’s always aligned with the local axes and the cursor always hits the plane (regardless of the actor’s orientation). I think the camera rotation needs to be taken into account here.
You rotate the plane by choosing different normal.
It depends - local axis of what? Of the player pawn? In other words - what do you want it to rotate with? Usually you can take the up vector of any actor and convert it to world space and use that as a normal.
Cursor can never hit the plane if the camera is looking away from the plane so there is that…
From your comment it seems that I don’t understand what you are trying to achieve. Please explain where should the plane be located (in world space since you want the result there) and how it should be oriented.
PS. Also please explain how your mechanic should differ from the top-down example.