I’ve been using Unreal Engine for about 4 months now and I’ve started to learn blueprint scripting. I now understand there isnt’s a “correct” way to do things, maybe just a better way for each situation. After watching a lot of tutorials, I’m creating a small horror game inside a manor. I want to use a puzzle system to open a big door. Basically, I have 4 knight armors placed in the level and I want to have 4 levers that make each armor rotate 90º when used. The goal is to get each armor in a specific position, which will unlock the door.
I’d like for the levers and the armors to be separate objects so I can place them wherever i want.
I now understand there isnt’s a
“correct” way to do things, maybe just
a better way for each situation.
Nicely put.
Basically, I have 4 knight armors
placed in the level and I want to have
4 levers that make each armor rotate
90º when used.
You could, sure; but you can still do it even if both elements are a part of the very same actor and it makes the communication much easier! For example:
When it comes to counting and finding matching rotations, the approach would depend on the scope:
if I needed but a single puzzle in the entire game and only once, I’d hard-code it in the LB
for something more reusable, I’d have the knights talk to the Door Actor - it would act as the manager
for something more modular, where you have many levels and many doors, I’d have the door actor create the knights + levers through an EUW and bind it all dynamically
And, as you said, there might be a better solution depending on the circumstances.
Another thing I was wondering about in this system is a way to identify which lever i’m looking at. The game is in first person camera and the 4 levers will be in a small control panel. I want the player to know which lever will be used by pressing the Input key and I have a small widget that can appear on top of them. However, i dont know how to set up an efficient way to identify the lever when they are close to each other