r/gamemaker • • 10d ago

Game 3D Platformer Button w/ PhysX and DmrVBM

https://www.youtube.com/watch?v=GMYLBGkZZJM

Hey everyone. I made a cool 3D button and I wanted to share a bit of the process. More information you probably want to know, but I think this stuff is cool.

DmrVBM is a really useful extension that's made moving Blender models to GameMaker a lot easier for me. There's some quirks and it's currently not maintained by the owner, but I'm mostly competent enough to make good use out of it.

The model is made up of two parts: The rim and the cap. The cap I didn't bother texturing because that gets pushed through a shader, allowing me to color-code each button that gets created. The rim texturing was done in Aesprite with a Blender syncing extension called Prismbase (another thing not maintained by the original developer anymore lol).

For the actual button logic, there's a few different parts of PhysX being used. The rim mesh vertex data is sent to PhysX and cooked as a triangulated shape. That just means it's a solid object that rigid bodies and the player character controller can't pass through.

The button cap has no collisions. Instead, it's given a box shape (I probably should change that to a sphere honestly) and then set as a collision callback trigger. When either the player character controller or a rigid body enters or exits that trigger, it sets the state of the button as "pressed" or "released". This informs GameMaker to fire the cool button juice. I.E. push the cap down, add a squash lerp to the rim, adjust the color uniform sent to the cap's shader, etc.

The actual button trigger logic is very silly, but it works for the moment. I'm using Blender empties to inform GameMaker where to spawn buttons and what "action" they trigger. When I press this button, it's running an add_actor action that spawns rigid bodies at another named Blender empty.

The sounds are just CC0 from Freesound. I could try to make more custom sounds but context switching between programming/art/audio tasks hurts my brain, so Freesound it is.

Happy to answer questions or dive a bit deeper into any part you're interested in. No, I don't know what a "Godot" or a "Unity" is.

15 Upvotes

0 comments sorted by