Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ManiCus |
I use that for rotating the camera of the player:
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
rotate_y(-event.relative.x * mouse_sensitivity)
var change = -event.relative.y * mouse_sensitivity_y
if change + camera_angle < 90 and change + camera_angle > -90:
$Cos/cos.rotate_z(deg2rad(change))
camera_angle += change
but when i try to move the position of the player with the asigned keys (or i press any key)
i have a problem with:
rotate_y(-event.relative.x * mouse_sensitivity)
in concret the relative error name: Invalid get index relative (on base: “InputEventKey”)
i don’t know if someone knows what is happening but if you can’t help my I will be so gratefull