Move mouse with controller

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ManiCus

Move mouse with controller :v

:bust_in_silhouette: Reply From: muratbozkurt35

you can use this i suppose.
use controller input to add or substract x and y values to mouse position instead adding motion to character.

:bust_in_silhouette: Reply From: estebanmolca

I don’t have a joystick to test it but this should work (works fine with arrows):

var mouse_sens= 300.0
    func _physics_process(delta):
    	var direction: Vector2
    	direction.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
    	direction.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
    	if abs(direction.x) == 1 and abs(direction.y) == 1:
    		direction = direction.normalized()
    	var movement = mouse_sens * direction * delta
    	if (movement):	
:bust_in_silhouette: Reply From: lukifah



movement is the Vector2 after getting joystick input strength

on ready you can

func _ready() → void: