Hello!
I am new to unreal engine and i am learning everything from zero. So i want to create a system where three doors in my Unreal Engine 5 level open with specific amounts of coins. As ex i have an apartment with three rooms, every room has a door. So how can i make every room door opens when player collect specefic amount of coins. Thanks alot.
Does it happen automatically? We collect x coins and specific door opens?
Or does the player needs to approach the door first?
Thanks for replay. I did this in the blueprint, i have 1 blueprint for one door, i will copy it and take it to another room. so every room has specific amount of coins that player should take to open the door in just this room. so yeah automatically after the player takes x coin for specific amount of coins should the door opens. no need to interact.
The setup you’ve got up there will not work too well. You need a centralised place that keeps the track of the stuff we collect. Consider the below approach for now, even though better methods may exist - but that’d depend on what we’re really creating.
- the
Door
actor:
Use the timeline you’ve got as is instead of my component (here for simplicity sake only)
- the
Coin
actor:
When the coins becomes overlapped, we destroy it.
- I’ve referenced the door actors in the
Level Blueprint
by dragging their references from the Outliner:
This script listens to coins getting destroyed and counts them. When a threshold is met, we open the corresponding door. This could work OK if you have 10 coins and 3 doors. Not so well if you have 100s of coins across 15 apartments, each with a bunch of doors. A different approach would be needed then. In this very example, the above may suffice.
You could also have the player BP count the collected coins instead - depends on whether it;s important for the player to know about this and whether this mechanics is needed in other levels.
But again, there’s probably a dozen ways to set it up - all depends on the desired details.
UR a genius, thanks alot, i will test it and see if that works.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.