In code formatting, everything I need to find how it’s done (if it can)
- Create a HasWeight component with a Weight (UProperty)
- Create a Grabbable component
- Attach an HasWeight component to FirstPlayerPawn
GrabbableComponent :
- If
owner Actor distance to Player Pawn
is less than GrabbingRadius (UProperty) - AND Player Pawn Camera Actor
is aiming at
owner actor -
Display a visual cue
for the grabbing action - If
player input
for grabbing - Set Grabbed = true
- Save
vector from Player Pawn to self
Block Player Pawn Camera Actor Rotation
- Each tick, move owner actor position to match saved vector
OpenDoor component
- WeightTreshold UProperty
- Instead of the Player Pawn,
get an iterable of all Actors having a HasWeight component
- Compute total weight of the ones overlapping and open door if > WeightTreshold
Level 2:
- Instead of keeping vector from Actor with GrabbableComponent to Player Pawn constant, use
position in the Camera
so that we can move the grabbed actor with the camera rotation -
Apply Gravity
to Grabbable Actors and Player Pawn, And reduce BoxTrigger Height
I’ll give it a try and see if I can achieve something by myself with UE Doc and Google