0 votes

Environment: Windows 10 Pro 64bit, Chrome, Godot 3.0.2, GDScript

Capturing the mouse must be done in an input handler like _input on HTML5 due to browser security restrictions. (See
https://godotengine.org/qa/25058/what-is-the-proper-way-of-capturing-the-mouse-in-a-html5-game for more details.)

While the mouse is captured the following code is used to integrate (aggregate) the relative mouse movements:

func _input(event):
    if event is InputEventMouseMotion:
        aggregated_mouse_delta += event.relative

It works fine on desktop, but on HTML5 event.relative seems to be zero all the time.

Where the relative movement vector is saved while the mouse is captured in a HTML5 game?

in Engine by (23 points)

Please log in or register to answer this question.

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 [email protected] with your username.