How to Ensure Sequential Interaction Logic Between Actors (Fridge → Cutting Board → Cut Meat)?

Hi, I’m working on a system in Unreal Engine 5 using Blueprints where the player interacts with objects in a specific order. Here’s what I have:

  1. Meat in Fridge (Actor A):
    – When interacted with, the meat is removed (destroyed) from the fridge.
  2. Cutting Board (Actor B):
    – When interacted with, if the player has already picked up the meat, the meat appears on the cutting board.
  3. Meat on Cutting Board (Actor C):
    – When interacted with, it turns into cut meat (swaps or replaces the actor).

Each of these is a separate Blueprint Actor.
Now, I want to make sure the player follows this sequence in order:
→ Take meat from the fridge
→ Place it on the cutting board
→ Then cut it with a knife

My Question:

What is the best way to manage this sequence logic between Blueprint Actors?
How can I prevent the player from interacting with the cutting board before taking the meat, or from cutting the meat before placing it?

Should I use a central manager (like a GameMode or GameInstance), interfaces, or variables on each actor? What would be a clean and scalable way to implement this kind of interaction sequence?

Thanks in advance!

1 Like

In this case, its easiest to have nothing on the chopping board to start with.

When the meat is removed from the fridge, it can just move itself to the chopping board.

When it’s chopped, it spawns the chopped meat actor before destroying itself.

In general, there are A LOT of ways of generalizing this. You might want to look at the save game, or a story management option, maybe a plugin.

1 Like

Thank you very much for your response.
Regarding the system where one Blueprint Actor enables the next action after interacting with another (e.g., “after doing ○○, you can now do △△”), does this mean that I need to pass variables or set up communication between them every time?

Also, is it necessary to use the Level Blueprint in such cases?
Or can everything — such as story progression flags or event triggers — be managed entirely within each individual Blueprint Actor?

As a reference, I’d like to ask:
If you were to create a series of events like this —
for example: after doing ○○, you can proceed to △△. Once that’s completed, you can talk to a certain NPC. After the conversation, a trap trigger box becomes active —
how would you recommend structuring this kind of task/flag-based story system in Unreal Engine?

1 Like

What you’re looking for, is a ‘quest system’

There are also plugins

1 Like

If I were you, I’d: Make state machine, using enums - like,
enum CHALLENGE {
MEAT,
APPLE,
BANANA
}

and then I’d make a variable of this enum in my blueprint, and store the current state (The thing that should be picked) and I’d assign a variable of the enum to each actor, like meat actor would have MEAT state, apple actor would have APPLE STATE, and so on.

and when Interacting, I’d compare the currentState variable to the actor state variable, and if they match then I’d destroy the picked actor.

1 Like

However, I’m not sure about a few things and would appreciate some guidance:

  1. Where should I store and manage the CurrentState variable? Should it be in the player character, the game mode, or somewhere else?
  2. How should I set and access each actor’s enum value? Should the enum variable be exposed and editable per actor in the editor?
  3. What is the best way to compare these values during interaction? For example, should I use an interface or cast the actor during interaction?
  4. What is the recommended method to pass or share the CurrentState variable between Blueprints (e.g., from GameMode to an item actor)?

I’d like to follow best practices, so I’m open to suggestions about structuring this logic properly in Blueprints.

1 In the object. It’s not just one variable, a particular object could have several ( or even many ) states. For instance a locked electronic door could have is powered, is locked, is open etc.

The other place to store these values is in the save game. Because each object needs to be able to remember what was happening before, when you start the game again.

2 Each actor is responsible for its own states. Generally speaking, its bad practice for actor A to change states for actor B.

3 Don’t compare them. Decisions are made by passing messages between actors. So the key actor sends the unlock message to the door actor when the player uses it. Then the key can remember ( save game ), it was used, and door can remember it was unlocked.

4 Don’t pass them. Just pass messages between the actors, that’s where using interfaces comes in.

2 Likes

Thank you for your response.
So, in other words, you’re saying that variables shouldn’t be passed directly between actors, and instead, communication should be done through notifications only.

In that case, what is the recommended way to send those notifications?
I’m having trouble finding a good method to reference the target actor that I want to notify.

1 Like

You can send values through an interface, if you want. It’s really up to you. I think if you ask anyone about this stuff you will get a different answer. It depends on so many things. A standard way of getting actor references is a line trace from the player. But if actor A always needs to know about actor B, then just use an actor reference variable, and set it in the level.

This is my NPC

Then, in the level

That’s one way.

Another method, the way I do it, is with the save game. Take your example

1 Talk to NPC
2 Leave apartment
3 Buy something
4 Come back

Every actor has variables that are useful to it, and can write them and read them to/from the save game.

If I try to leave before talking to the NPC, the door checks its variables and sees its status is ‘NPC’, and says, ‘is there something you need to ask the NPC?’

When I interact with the NPC, it can write ‘Shopping’ to the save game, as the door’s status.

Now, when I try to open the door, it sees its status is ‘Shopping’ and lets me out.

But if I try to come back in, it won’t let me, because I have not been shopping. A message can appear like ‘Don’t you need to go shopping?’

So I go to the shop, and I buy some toothpaste ( or whatever ), when I pickup the toothpaste, it writes ‘Shopping done’ to the save game as the door’s status.

I go back to the apartment, and the door will let me in.

Using the save game like this is cool in two ways

1 If the player quits the game before the whole scenario is complete, we still know how far we got ( storing the player location works the same way ).

2 It’s a bit like passing status values between the actors, but we never actually had to do it :smiley:

I use the save game like this in the game I’m currently writing. Its covered all simple story scenarios so far.

1 Like

Thank you very much. I feel like I’m starting to get the idea now.

It seems better to manage progression states using variables inside the BP_SaveGame.
The method shown in the image I was referencing may be easier in terms of access, but it only supports one specific case.
Since I will need to reference various things in the future, I realize now that it’s probably not a good idea to continue using that approach.

Also, I’m sorry if my understanding is still shallow, even though you’re explaining everything so clearly.
I still can’t quite visualize how to smoothly connect “Talk to NPC” and “Leave apartment”.

For example, I was thinking like this:
After talking to the NPC, the BP_NPC sends a flag to BP_SaveGame, and then BP_SaveGame sends a message to BP_OpenDoor.

But now I understand that the BP_SaveGame event graph itself is not used directly.
Instead, you create a SaveGame object (using Create Save Game Object), assign your custom BP_SaveGame class to it, and then save the current progression state (like a step counter or flag).

Then, when the player talks to the NPC, you save “Step = 1” to the SaveGame.
Later, when the player interacts with BP_OpenDoor, it loads the save slot and reads the progression step.
If it sees “Step = 1”, then it allows the door to open.

Is that the correct way to structure the logic?

If I’m thinking about this all wrong, I sincerely apologize.
I truly appreciate that someone like you is taking the time to help a beginner like me. Thank you so much.

1 Like

Yes, along these lines. The save game is just a sort of box you can keep variables in. The great thing about it, is it can remember everything even if you stop playing the game, and then start again later.

You probably wouldn’t call the variable ‘step’, though, because you’ll never remember what its for :slight_smile:

You might call it something like ‘Apartment door status’, and you could make it an int, but it’s easier to make it a enum type. That way, it can have values like ‘NPC’, ‘Shopping’ and ‘Toothpaste’.

So the default value of the variable ‘Apartment door status’, would be ‘NPC’. The door won’t open with this value. When you talk to the NPC, that actor updates the save game so that ‘Apartment door status’ = ‘Shopping’.

When you buy, or pick up, the toothpaste, it ( the toothpaste BP ) updates the save game variable ‘Apartment door status’ = Toothpaste, and the door will later let you back in again.

So I can make my enum type

In the save game

Inside the door BP

Inside the NPC, after the conversation

This is just a very simple mock up of what I mean, but maybe you get the idea.

I’m using a function library to talk to the save game ( much easier )

1 Like

You are my hero. I’ve been researching this for a while recently, and now it’s finally resolved!!!
I truly appreciate it from the bottom of my heart. Function Libraries are incredibly useful — I had no idea!

Now, if I want to move on to the next mission after completing the current one using the ApartmentDoor enum, does that mean I can just create a new enum (e.g., for the next mission), add a corresponding variable to the SaveGame, and then replace the nodes with Switch on <NewEnum> to reuse the system?

Do I need to modify anything in the ReadSG or WriteSG functions in the Function Library, or can I leave them as they are?

1 Like

That’s right all you need is a new enum ( or whatever type of variable is useful ). And yes, add to the save game.

Did you get it working?

1 Like

It worked perfectly, of course!! Thank you so much!!

Now, I’d like to display the current task at the top of the screen each time the task changes, like “Talk to the NPC,” “Open the door,” or “Go shopping.”

Is there a recommended way to trigger a node the moment the ApartmentDoor Byte variable changes, so I can update the task UI accordingly?

I’d prefer not to use it, but I was able to achieve the desired behavior by using Event Tick to constantly check the variable.
When the enum reaches the desired value, the widget is shown — but I’m hoping there’s a better way than using Tick.

1 Like

Great :slight_smile:

Yes, instead of tick, you keep the widget on the screen the whole time, and when a BP updates something, it can tell the widget to change the text.

When you create the widget, the default output is typed

But if you use a generic widget object reference variable, you can still store it

Once a BP knows this reference it can use an interface call to ask the widget to change the text.

One place you can put this reference, is the save game, so any BP can get it from there :rofl:

You could also use the game instance.

1 Like

Thank you so much!! It was a great help.

1 Like