Character doesn't follow mouse properly

I’m developing a game with isometric view. In this game, the character is supposed to follow the mouse, looking at it’s position at every moment.

My issue is that following the mouse feels rather like a suggestion to the game. The character does not look at the exact position of the mouse. (see video)


Here’s the line of code responsible for this:

REMOVED

If anyone knows how to fix this, please help me.
can’t think of any other way to approach this, any help is appreciated, thanks in advance.

2 Likes

Double-check how you’re calculating the angle. The math.atan2 function should work, but make sure you’re using the correct axes. You may need to adjust the parameters or offsets.

If this doesn’t work, make sure that the followMouse function is being called continuously, as in the RenderStepped event. This will keep updating the character’s position in real time as the mouse moves.

2 Likes

You can try this thing here for angle calculation, it might help.

Vector3 | Documentation - Roblox Creator Hub

Example usage for clarification:

Basically you just put Vector1 on one side, Vector2 on the other and it should work.

If it doesn’t, I wish you luck finding a solution

2 Likes

Thanks both of you for these solutions, however, I’ve decided to find another approach for the game and now the character won’t follow the mouse, therefore I’m closing this topic.

2 Likes

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