Download

Blueprint Communication question(s)

First off, Thanks for Reading!

Second,

Hi I am working on a VR project based on the UVRF template by @ENiKS (Amazing template! You should check it! Link below)

So the project has the following things in it;

A Roll door (with animation)
A button to close the Roll door (for now an overlap event in the door blueprint)
A lamp (just a light)
A Jig (static mesh with animation)
Some parts (static meshes that go into the jig)

The way it should work:
At begin play the door is open and the light is burning a color, let’s say red.
The jig is empty and the parts lay on a table.
When you press the button to close the door nothing will happen because the jig is empty.
But when I pick up the parts and place them in de correct position on the jig, the light turns green and the door closes when the button is pressed.
When the door is closed the jig starts its animation
The door opens after the jig animation is completed and the light turns orange again.
And the process could be repeated as long as one would like.
So here comes the question;
What is the best way to communicate in this process between the blueprints?
I tried it with event dispatches but that gave me errors that I wasn’t able to solve
I tried a blueprint interface, but that just ran the whole thing without waiting on each other.
I really hope that someone could point me in the right direction as I have no clue on where to go right now.

Oh, and if you have any questions, please ask!

Thanks in advance,

Mettus.

(sorry if it was hard to read, I’m not a native English speaker)

(Here is that link I was writing about in the beginning:
https://forums.unrealengine.com/deve…tational-grabs )

edit: here are some pictures of the blueprints;

I do it with casting. I can use interfaces or event dispatchers but when the entities are not many I simply use casting.

I would make a couple of variables in game instance like :
Boolean : item 1 taken?
Boolean : item 2 taken?

When an item (actor BP class) is taken it will cat to game instance and set the corresponding variable to “true”

Not when something is dependent of that item being taken like a door opening, it will cast to the game instance and ask it if the Boolean is true using a simple branch node. If true it will trigger animation of the door which I simply use a timeline with lerp node to set component new location instead of using a matinee or a sequence.

Using a game instance has the advantage of carrying over the variables to any new level.

Now, you can also set another variable in the game instance: Boolean :" Door 001 can open? " which is set to true after all the conditions have been met.

the door BP class should have a trigger inside it, which on “event start collision” will ask the game instance is the boolean can open door 001 is true?

If the variable is true it will always open the door no matter how many times. Use on end collision a reverse node of the door animation.