Escape Room - How to Activate Door Manually

Hi there,

So I set off on my own to try to active the door manually. To accomplish this, I had to disable the OpenDoor.cpp tick functionality that checks mass or trigger volume overlap.

I started out by adding a new Component called Activator to the DefaultPawn_BP (similar to how we did with the Grabber). This is my Activator.cpp file:


Here is my modifications to the OpenDoor.cpp:




Anyone here who can help me figure out how to get the animation to play? I’m thinking that I need to somehow have this triggered in the tick() function of OpenDoor, but maybe I’m wrong. I can get the door to open and close, but no animations, which defeats the purpose.

Thanks!

After several modifications, I got this working the way I wanted it. Of course, it won’t work at the same time as the weight functionality, but that’s fine. It’s more messy than I would like, but I’m only experimenting so that’s understandable.

What I did:

(I modified the Activator constructor to set a member variable Door as well as a member variable IsActivated. Then in the TickComponent() I check if we have a Door ptr and if IsActivated is set to true. If so, I check to see if the door is closed. I then call opendoor from OpenDoor.cpp and pass in the OUT parameter IsActivated (it gets set to false once the door is fully open). This is the same, but opposite behavior for CloseDoor(). Once IsActivated is false (when either function completes fully) I set the Door to nullptr so that the TickComponent() stops running until the button is clicked again.

Like it said, it’s ugly and I’m not thrilled with it at all, but IT WORKS! Get it working, then clean it up.)

Any advice from some experienced Unreal Engine devs? Thanks.

So, I found a way to make BOTH functionality work–both weighted trigger and manual activation. Instead of the weighted trigger opening the door, it merely unlocks it. So, I set the door to locked on init. The only way to unlock it is to add weight to trigger volume (pressure plate). So either standing on it (stepping off locks it again), or putting enough weighted objects on it. This allows the door to be manually activated (opened or closed). Anyway, these are my thoughts after the course for those who would like to have the ability to manually activate a door/window/etc.

Privacy & Terms