|Topic was automatically imported from the old Question2Answer platform.
I’m making a 2D Top Down shooter game. Inspired by Enter the Gungeon.
In this game, you can use the mouse or the right joystick, and your player will look at it.
I already know how to make this work with a mouse, as I can get the direction based on the player and the cursor position. It also applies an offset to the camera if it is far enough from the player, to move it a little further to where the character is looking at. However, I don’t know how this would work with a joystick.
I thought of making the cursor able to be controlled by the joystick, but the
Input.warp_mouse(Vector2.ZERO) method does not seem to work. I think it also removes my custom cursor image.
I also don’t know if it is a good idea to make a custom cursor with a TextureRect, and move with also with the joystick, as I’ve seen it can have a delay.
If I could make an Input action for the mouse and get a vector based on its position, it would work easily, but the InputMap system seems to only work with buttons.
What could I do?