0
Answered

Handle rotation on mouse drag

Einar 5 months ago in Game Creator updated 5 months ago 2

Hi, I'm experimenting with my new purchase, and wondered if you have any tips for how to set up actions controlled by mouse drag. For example opening of a drawer, or rotating an object you are looking at, reacting to both direction and speed of mouse movement. Is this kind of continous input/feedback feasable with Character Creator? If yes, please point me in the right direction. If no, I'll just handle it with my own scripts, and use CC for the rest.

Unity version:
Game Creator version:
GOOD, I'M SATISFIED
Satisfaction mark by Einar 5 months ago
Answered

Physics interactions like those are quire difficult to do in a generic way that supports all major platform (something that works both on mobile, using a mouse and using a console controller). So currently there's no way of doing this. However, if you're going to create a custom script for that, I'd recommend maybe also using a custom Trigger. That way you can reuse it and take advantage of Game Creator's API.

+1

Thanks! I've experimented a bit, and for the time being I can handle all mouse input drag detection with the standard Game Creator triggers (On Mouse Down, While Mouse Down and On Mouse Up) and a single global variable to store the current mouse raycast hit. Then I can simply convert the mouse drag movement to object rotation in a custom action from the While Mouse Down trigger. Suits my prototyping needs just fine!