Hi, I want my camera to trigger an event (opening a door) but it doesn’t work. I attached a static mesh (sphere) to my camera with generate Overlap Events check and OverlapAll as Collision preset. I also created an event graph and I think the problem is there.
Yes, it work in play mode with the third person character
What do you mean by break point?
Does the overlap event get triggered when overlapping with another actor?
And the overlapped actor is found to have the “Camera” tag?
I think my last comment might be the problem. You have the camera tag set for the camera’s sphere, but you’re checking against the overlapped actor’s tag.
Did you put a break point on the play animation node to see if the overlap event is being triggered?
Right click on the Play Animation node to the right of OnActorBeginOverlap. In the context menu that appears you should see an “Add Breakpoint” option.
If you click that, you’ll see a red circle appear on the PlayAnimation node. Run the game again and test for an overlap with the camera’s sphere. If an overlap is triggered then the game will pause and bring up this blueprint at the point it is called.
If it does not, then the overlap event is not being triggered.
Why do you have a sphere attached to the camera? I would go into the door blueprint and set the trigger to activate/flip between opened and closed upon any overlap, assuming that you have no other assets it could interact with.
Okay, I’m understanding a bit more what you’re trying to do. I didn’t realize you have a trigger volume set up. Is this set up around the door?
And you’re hoping the sphere attached around the player’s camera will trigger the trigger volume?
It still doesn’t work but I check Generate Overlap Events
I have a sphere attached to the camera because I want the door to open when the camera passed on the trigger volume
Yes, it’s checked
Does the trigger volume attached to the door have the generate overlap events checked?
It should have this set up by default since its a trigger volume.
What you mean by boolean variable?
Just use a capsule. I’m not really sure where your problem is as getting a player to walk into a trigger zone to produce an output is rather straightforward. You can try custom rather than overlap all and checkbox everything. There’s also the possibility that your animation is constantly starting from frame one while overlapping so it appears it though it’s not running. Try adding a boolean variable after play animation, and then before play animation, put a branch to check that condition. That way you can ensure it plays once upon overlap rather than potentially starting from frame 1 over and over again.
So create a variable of Boolean type called something like Animation Played. When the animation has played, set the Boolean “Animation played” to true after the Play Animation node. Before the Play Animation node, put a branch that can check the condition “Animation played” and if it is false, tell it to play the animation. If it’s true (already played in other words), do nothing. I’m fairly certain that’s where your problem is because it will keep performing the “play animation” node from the beginning, as long as the overlap is true. You want to set up a flow system to only allow it to play once.
Can you post an image showing how the sphere is connected to the camera?
(Reason for asking: if, for example, the sphere is offset from the camera so that you can’t see it at runtime, are you sure that the sphere is actually moving with the camera and entering the trigger volume?)