I need the character to aim where the mouse is pointing, but so far I can aim where the mouse hits an obstacle (floor for example), it turns out I somehow need to capture the direction of the beam and the direction from the character forward to the direction of the mouse, but how is it do not understand yet.
How can this be done?
Add: on screenshot, the red line is a beam from the camera to the floor, the blue line is the level of the character, it turns out that he should look towards the intersection of the red and blue lines, that is, as if there is an invisible plane at eye level and the beam should hit this plane and not fly to the floor … .