Creating a Stacking Game for My Students - Physics?

I tried to create a stacking game to demo to my students how Needle Engine works for games, but I failed.
Does someone have a quick demo how to add rigidbody with Gravity to a gameObject, and test if a gameObject collides with a trigger Collider Box to increment a score by one and display the score in a UI Text box, or reveal a “Game Over” text box?

Original Post on Discord

by user 581381221087445033

Hey! So something like this: should “just work” (regular BoxColliders and Rigidbody in Unity) – which issues did you run into?

What you describe sounds like a great starter scene / sample though, can you add it here: needle-tools/needle-engine-support Demo And Starter Ideas · Discussions · GitHub

I assume this has to do with getting callbacks for physics events (like in Unity with TriggerEnter <> TriggerExit) ?

Thanks. Yes, 20K is very close to what I want. But, I couldn’t even load the meedle.engine.samples from GitHub to play with it.

by user 581381221087445033

What stopped you from using the samples?

OK. Got it running in Unity now. Not sure what I was doing wrong.

by user 581381221087445033

I’m currently improving the collider support too - making it more like in Unity with onCollisionEnter Exit and Stay events

Thank you, thank you for adding Unity like collider support. That will be great.

In the 20K demo, what would be the easiest way to add a cube that, is either a trigger or collider that adds a score in a UI Textbox when any hat hits it?

If you can write it and send the cube and UI Textbox & TS script to me as an example in a Unity package that I can import, to study, I’d appreciate that to pass on to my students.

(Seems faster than you taking the time to talk me through it step by step).

by user 581381221087445033

Or, could I copy and paste a gameObject from SpacialTrigger scene?

by user 581381221087445033

@Darius Clarke I’m just adding callbacks that make working with collisions much easier and will try publish a new version and share an example with you later

the scene looks like this right now

ok fun already :smile:

Works in AR too :slightly_smiling_face:

Hey can those make some random pling sounds when colliding? :smile:


quick AR video

will publish now so you can play with it in a moment @Darius Clarke :slightly_smiling_face: first here’s a quick deploy

Awesome! Thank you, thank you! Trying it out right now! :slightly_smiling_face:

by user 581381221087445033