Building escape
lesson 115 Grabbing an object
How to go about coding this to grab an object and place it in a pressure plate to open the door
Things we need:
Get player weight
A new object (AActor) we will use a cone
Gravity setting to measure weight for the pressure plate
Collision detection
Things we know:
we have our base actor which activates CloseDoor()
We have our doors which run the OpenDoor() and ClosedDoor()
We have our pressure plate which activates OpenDoor()
The actor will walk over to the cone, grab it, carry it, and place the cone in the PressurePlate to activate the door.
Create cone, set mobility to the cone so it is not static
ChaliceOfOpulence= get name of cone actor
add weight value to ChaliceOfOpulence and expose weight value UPROPERTY(EditAnywhere)
Add collision to ChaliceOfOpulence
add a way to take a weight value to the PressurePlate and expose weight value UPROPERTY(EditAnywhere)
add the ability to pick up, carry, and put down object (functions)
add conditional for object weight vs player weight
add a conditional statement to the if blocks in the TickComponent function.