How to grab chair

Before I read anyone else’s idea…
The main logic goes in the pawn. It can use inheritance because there is only one pawn in this game. Or it could be a component if you want AI pawns to be able to grab in the future.
The chair needs to indicate if it is grabbable or not. You don’t want to be able to grab the door for instance. A Grabbable component added to the chair perhaps? CanGrab property?

When the pawn collides with the chair the pawn should check if the chair contains a Grabbable component (how?). If it does then set a Holding property on the pawn to indicate the actor that the pawn is holding. Now whenever the pawn moves it needs to update the location of the pawn. I think this should be done by ‘attaching’ the chair to the pawn (how?). Turn off physics on the chair?

Privacy & Terms