- Home /
How to make a cube rotate around player depending mouse position using New Input System
Hi, I'm trying to make a fight game with local multiplayer using Unity's New Input System, but I want a aim indicator to make the player know where is aiming, but I don't know how to make the indicator rotate around player depending the mouse position or joystick position without making the indicator fly out the screen, I made a very noob lines of script inside my player controller script to make the cube move to mouse position, but of course, it just changes position to mouse position (if mouse pos is -506, 109 then the cube moves to that position), so I wanted to know how to make the cube rotate around the player and don't make it just flying away the screen Vector2 aimpos = new Vector2(aimPosition.x, aimPosition.y); aimIndicator.transform.position = aimpos; Debug.Log("LOOKING: " + aimpos);
The Debug.Log is to see where mouse is pointing, and with this, again, I want the cube to rotate the player and face the mouse pos without changing the position, how can I do this? please, I need help :c
Your answer
Follow this Question
Related Questions
Need help on the 3ds max style camera control 0 Answers
Move player canvas along with player parent. 1 Answer
camera acting weird... 1 Answer