Demonstrates how you can have pickable bodies inside a SubViewport based world with Godot 4.x.
Even if those components are created with instantiate().
Disclaimer: this was created while learning Godot programming. I'm a web developer by trade, not a game developer. Take this sample with a grain of salt.
Note that this repository is provided "as-is" and will most likely not receive any (security) updates.
Running this sample allows you to:
- See
input_eventat work for the Static Body's (those with the Godot icon sprite) by clicking them - Add fresh instances of that component through code by pushing the button, and see they're also connected
- Drop some
RigidBody2Dballs on top of it all to ensure physics is working for the stuff inside the SubViewport
And that's about it!
Here's what things operate like when running:
