I can benefit from using the built-in physics to work a solution around this problem:
- Objects have a mass in kg.
- I can create a component to my player pawn. This component could be called “ObjectGrabber”
- It shoots a ray towards the object it’s trying to grab. The component possesses a property called “WeightThreshold”
- If the object’s mass in kg. is less or equal than the player’s WeightThreshold, then the player will “grab” the object
- If not, the player won’t be able to grab the object.
- The object that’s being grabbed will be referenced on a variable
- If the variable is null, no object is being grabbed
- If the variable is NOT null, then an object is being grabbed
- Objects can be grabbed IF bOverrideMass is true!