Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | fviktor |
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
What is the proper way of capturing the mouse in a HTML5 game? - Archive - Godot Forum 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?