Grabbing system ideas

First of all, I admit that I’ve forgotten what component and inheritance are, and can’t find where they were discussed. Sigh…

I have two ideas for how this might be implemented. A raycast system or a collision system.

For the raycast system, the player would have a ray beaming from their camera. If their beam passes through an object, we could check whether it is within a certain distance, then we would check if it has a “grabbable” property, then check if grabbable is true (Might want to turn grabability on and off for certain objects at certain times. Say, if it has an object stacked on top of it, we might turn grabability off).

For the collision system, we could parent a small ‘GrabDetector’ collider object to the character and have it hover invisibly at a reasonable distance from them. An object could then be grabbed if this collider overlaps with the collider of a “grabbable” object.

[I now have to leave, so I’ll respond later with how I think picking up and setting down the objects might be accomplished]

Privacy & Terms