GodotVR / godot-xr-tools

Support scenes for AR and VR in Godot
MIT License
521 stars 74 forks source link

Pickable and climbable specified by collision layer instead of inheritance from a special scene #538

Open goatchurchprime opened 1 year ago

goatchurchprime commented 1 year ago

If we have a function_pickup attached to the player's controllers which implements this feature, why do we also need a XRToolsPickable with pickable scene for any such object to be inherited from?

Can't we move all the functional behaviour from pickable.gd back into function_pickup.gd so that pickable objects don't need to carry their own scripts and scenes like this?

Can't we use collision layers to specify which things can be picked up?

It seems that the current design forces us to use RigidBody3D, when StaticBody3D might be more appropriate, and not be able to inherit these objects from a different class.

An example I am thinking of is where there is a board full of post-it notes you can pick up and move, and which stick themselves back onto the board when released close to it.

Same argument applies to Climbable, only more so, since the climbed objects don't do anything. (Or maybe they do something such as when they are a rigid body and they fall towards you when you try to climb up them, in which case forcing them to.)

Malcolmnixon commented 1 year ago

@BastiaanOlij and I have discussed moving from inheritance to composition to help with this problem. Consider if you find some nice package of 3D objects you'd like to drag them into your environment and "make them pickable" or "climbable". Currently that would entail:

Instead it would be far easier if we could just attach "modifier" nodes: image

This approach would: