Get mouse position each frame?
Posted: Tue Dec 09, 2025 8:32 pm
I'm trying to create a line from an object to the mouse, and have it update each frame
I'm not sure the best way to get mouse position each frame.
The only way I've seen in the documentation is to use a custom input, but that will only activate when the button is first pressed
i.e: script.on_event("my-custom-input", function(event) local cursor_position = event.cursor_position end)
Is there any other way to get the mouse position?
Thanks!
I'm not sure the best way to get mouse position each frame.
The only way I've seen in the documentation is to use a custom input, but that will only activate when the button is first pressed
i.e: script.on_event("my-custom-input", function(event) local cursor_position = event.cursor_position end)
Is there any other way to get the mouse position?
Thanks!