The way I'm thinking about the Grabbing System

Here is what I think:

  1. First I create a script on the chair (i give it a component -has a-)
  2. This script will first have 2 macros to editanywhere, to identify its trigger and it’s overlapping actor.
  3. Then check with raycasts if the character is at a certain distance from the trigger and if it’s the character.
  4. And finally while holding a key button we can move the chair, to drop it we let go off the key.

Technically, it could be done completely without raycasts altogether, just a bit of simple math… Pardon my Psuedocode:

If (DistanceToPlayer()<GrabDistance)
    If (PlayerIsFacingObject())
        ObjectCanbeGrabbed=true;

I left out a little math for those functions, but they’re easily calculated. I’d probably set an angle range in the PlayerIsFacingObject to say if the object is facing +/- 15 degrees from the object.

1 Like

Privacy & Terms