My Notes on a Grabbing System

So, this post will be something of a stream of consciousness, I apologize if it is in anyway hard to follow for those who come later and/or are interested in how others viewed the problem.

Looking at the grabbing system from the perspective of inheritance versus making a component. There’s a fundamental question that must be asked: how easy to port this code around should things be. If the grabbing system is merely inherited from, say, a player controller, then it’s difficult to give the ability to other entities if a game were to be designed that way.

Therefore, it stands to reason that it would make sense to build this as a component that lives on something like the Default Pawn (or on an antagonistic entity who might grab and move objects away from where they may be useful)

To grab something we’d need at least 2 objects: A component placed on the player that controls projecting some kind of collision handling data from the player that is only active/checked given a specific input (mouse click maybe?) and a Component placed on Actors that would be targets to be picked up.

Not sure if I could set it up such that instead of needing to set an ‘Object To Be Grabbed’ I instead only respond to objects with the correct component on them, allowing me to set up that object to contain more data I could use down the line, but I think that would be a much more scale-able way of accomplishing a grabber in terms of building up larger levels.

Perhaps the grabber input handler (on the player) could be a component, and the Grabable objects could themselves be Inherited from Actors.

Those are my thoughts on it anyway, I’m interested to see how it could play out.

Privacy & Terms