Detect collisions between user avatar and MML elements #18
Replies: 4 comments 1 reply
-
Please contribute use cases, prior art (e.g. other engines / formats implementation of this behaviour), and even proposed MML code that you would expect to work or even code that may be problematic. |
Beta Was this translation helpful? Give feedback.
-
passing some info on collision position / normal / velocity / etc opens up a tonne of cool stuff. tbh position would be very useful for |
Beta Was this translation helpful? Give feedback.
-
This is now tracked by #51 |
Beta Was this translation helpful? Give feedback.
-
This has been released in https://github.com/mml-io/mml/releases/tag/v0.3.0 🎉 |
Beta Was this translation helpful? Give feedback.
-
What is your idea?
The ability for JavaScript in the MML document to be able to detect that an element has been collided with by a user's avatar.
Why is it important?
This would allow elements to react to users standing on them or walking into them. An immediate example is being able to make a large piano that plays notes when users stand on the keys.
What do you propose?
Dispatch an event to elements when a user's avatar collides with them in much the same way elements receive click events.
This event type may have to be throttled by the game engine in cases where the user's avatar is moving past an element and frequently making and losing contact (e.g. brushing past a wall or door when moving through it)
Beta Was this translation helpful? Give feedback.
All reactions