Download

How can I to get an animation to be triggered by proximity of a StaticMesh actor? [HELP]

Hi
I’m new to Unreal and I need some help.
So I’m working on my first demo project as a way to get more familiar with Unreal.
My game calls for the player character to grab a particular item (a static mesh actor) and bring it close to a door that will slide open if detects the item near.

I have the door slide animation and a trigger volume around the door but I can’t get it to work with the mesh actor I want. So far I’ve managed to get it to open with by pressing a keyboard key while being inside the trigger volume.
First I tried using an Equal object node with a reference to the item and the trigger volume’s OnActorBeginOverlap node, it didn’t work. Later, after looking up forum posts and going through the documentation, I figured I should be using a Cast to StaticMeshActor with the trigger volume, but I still could not get the door to open. I tried connecting a Key press node to the Exec of the Cast to node and it also wouldn’t work.
I believe the volume trigger can detect any actor that is within its border, right? What nodes could I use to make this work? Or is it the way the nodes are connected? Maybe I’m not properly referencing the StaticMeshActor? is it an instance of an actor or the actor proper?
I’m a bit lost and I feel like I’m grasping in the dark, like I’m just randomly connecting nodes hoping something will work. I don’t even understand what I’m doing wrong.

If it helps, I’ve added an screenshot of my blueprint.

Thanks in advance. Cheers!

@Dr.Chikenly
Hi man, the first big problem you have is connect “the cast to staticmeshactor” the white cable is the “Execute” so if noone plug in it, it will not be executed at all !
Why are you trying to create an empty mesh component ?

Break the code down in smaller pieces, Remove all but the 2 overlap .
pin out the “other actor” and get the class. Use a print to show this value. (Checkin that the Overlap Works and check who detect) If does nothing happenz, is a collision problem.

Try setting the Door-rotation to 90 when you enter the trigger
and to 0 when you leave.

If both this things work you can try adding a timeline or a sequencer for opening it smoothly.
The nodes will be only.
Overlap-Start ----check if is the right actor----- if yes —play animation1
Overlap-End ----check if is the right actor----- if yes —play animation2

in the future you may want to “cast to something” just to check if is the right actor or kind of actor.
So, From an actor reference you can get his class too, or if he have some tag, or if it is a really specific actor.
Beware that 2 actors named “bob” of the same type, are not the same actor anyway. ( they have the same class )

Casting is for access the variable or event inside another actor. if you just need to check if is the right actor you can use the things above.