I am working on a project in Unreal Engine 5, where there are cabinets with 2 or more drawers/doors that need to be opened sequentially by pointing the camera at them and pressing the E button.
For example, with a single door (like an entrance door), everything is fine and works perfectly.
However, when I try to create a blueprint based on it, but now for sliding drawers of a desk or nightstand, they either open all at once, in sequence, or sometimes only one opens. How can I solve this problem?
1 Like
If you look at the result of the hit, it also tells you the hit component. You can adapt the interface call so that you still send it to the actor, but you can also pass the component as a parameter.
Then inside the actor, you can move the component you were passed.
During the simulation, no information is displayed. I don’t quite understand what you mean.
On top of that, the upper shelf slides out even when the ray doesn’t hit it. Moreover, it slides out even when it passes through an object with collision (the cabinet it’s inside).
However, if you place another object in front of the drawer, the ray won’t pass through it, and the drawer won’t slide out.
1 Like
This
You can use it to find out which component was hit, inside the blueprint.
Of course, all the drawers need to have collision set, otherwise the trace won’t hit them
Okay, I figured it out. But now I have another issue. During the simulation, when I approach an object and press the interaction button to open, for example, a cabinet, it doesn’t open. However, if I take a step back or forward (it doesn’t matter), it opens without any issues. The same happens with all blueprints.
I used a child mesh and added several ready-made drawer blueprints to the table. It’s worth noting that if the blueprint uses only one mesh (like a door), it
works perfectly on the first try.
It’s very hard to know from here… child BPs sounds good though, one way of doing it.
I would add debugging code everywhere, just print strings, so you can see what’s going on ( or not ).
Using a child blueprint didn’t help me. The delay is still there, and until you take a step to the side, nothing will open. I decided to approach it differently, using a line trace for object and outputting the object types to make an array for WorldDynamic
.
But the problem is that I don’t understand how to combine two logics: the drawer sliding in the cabinet and the door opening in the same cabinet. Moreover, I’ve been trying for a week to create a blueprint that opens the cabinet door along the Z-axis.
Nothing works, and I’m starting to feel defeated.
Here’s my working blueprint for drawer sliding, and it works without delays. I tried to do the same with Relative Rotation
, using the appropriate nodes, but the Branch
doesn’t pass the logic further.
I can’t figure out what’s wrong.
If there’s another way to solve this problem, I don’t understand how to combine the two logics of Relative Location
and Relative Rotation
independently of each other.
Try it like this.
Make a parent blueprint, it’s got nothing in it except
It implements the BPI, as you can see. You also need
Then I make a child from that
and make it a drawer ( basic )
See how I can use the stuff from the parent, and I only need to 0-1 variable. You get the timeline nodes from here
For a door, I do the same ( make a child ), but now I do a rotation with the TL
Now, in the level, I have a line trace coming from my player, it just says
and…
So I can make a chest of drawers or a room with this stuff in. Does it make sense?
What is it? How i can get this node?
I searched, but I didn’t understand anything(
1 Like
Is it supposed to be signed like that?
I don’t have anything like that in my search,
and only 24 overridable options are displayed instead of 27 like you have.
1 Like
It depends what you called it.
I did add this component, but how do I call parent: timeline
… and what is it even called?
You’re not angry because I don’t understand something, are you? I’m just writing through a translator without knowing your language.
1 Like
Not angry at all ( it might look like that because I type short messages )
Remove both of those timeline nodes you have ( in the child ), then use the ‘override’ thing to re-add. You should get both joined.
Another way, is to right click on the red node, and choose ‘add parent event’.