It looks like you're new here. If you want to get involved, click one of these buttons!
Player is not always looking directly at Pointer (Unity3D 2019.3.13f1)
Hi, I am currently prototyping a 2.5D Top down Dungeon Crawler. I have set it up, so the player rotates to look at the pointer. In some cases it still seems that it still tries to rotate towards the pointer. However, the pointer is sometimes either offset, or not recorded correctly.
The bug occurs in 2 instances:
1) When the player transition between rooms in the dungeon
2) When the player uses the grapple gun a few times
In the embedded video the scenarios are shown:
I am using the new input system, which may be a source of this.
Below is the code I use to get the mouse position in world space.
For testing purposes to see what feels best I created two separate methods to set player rotation. The bug however occurs in both methods so I assume the issue lies the ‘GetRelativeCursorPosition()’ function.
The method used in video to highlight the bug:
Other method (used to smoothly rotate player)
I then call it in the update function when player is not grappling, so the player character looks in the direction they are grappling