0 votes

[Solved trying to delete this post]

inputEvent is InnputEventMouseMotion eventMouseMotion

the Mouse's relative variable is stored in eventMouseMotion not inputEvent

Hi All, I can't seem to access the variable "Relative" in an InputEventMouseMotion

Things I've tried:

  • Casting the inputEvent to InputEventMouseMotion
  • inputEvent.GetType() returns "Godot.InputEventMouseMotion"
  • inputEvent.GetType().GetFields() - returns an Empty array
  • different iterations of "Relative" (relative, Relative, GetRelative())

Code: (I Could not figure out how to properly format my code)

(will keep searching) - currently trying to print out all variables and methods of the object.

in Engine by (12 points)

1 Answer

0 votes

Untested, but...

public override void _UnhandledInput (InputEvent ev) {
    if (ev is InputEventMouseMotion) {
        InputEventMouseMotion m = (InputEventMouseMotion) ev;
        // here, you can reference "m.Relative.x"... 
by (16,676 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to we[email protected] with your username.