Topic was automatically imported from the old Question2Answer platform.
Asked By
anonymous
I’m fairly new to Godot but I’ve used Unity before. I am trying to implement a 3D Mouselook system. In Unity I can get the horizontal Mouse movement with this:
Input.GetAxis ("Mouse X");
What is the equivalent of this in Godot? How do I get the amount of mouse movement? I can’t seem to find anything useful under Godot’s Input class.
I have figured out how to get mouse movement, but it’s not something directly equivalent to Unity’s Input.GetAxis("Mouse X").
public override void _Input(InputEvent motionUnknown) {
InputEventMouseMotion motion = motionUnknown as InputEventMouseMotion;
if (motion != null) {
// if we get here, then the input is mouse movement
// and it's now in the variable "motion"
// do something with "motion.Relative" which is the movement Vector2
}
}