x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How can I have my camera trigger an event

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.

alt textalt textalt text

Product Version: UE 4.18
Tags:
capture.jpg (169.2 kB)
capture2.jpg (17.5 kB)
capture3.jpg (23.9 kB)
more ▼

asked Apr 26 '18 at 11:03 AM in Blueprint Scripting

avatar image

Jblink
1 1 1

avatar image Velrin Apr 26 '18 at 11:07 AM

Does the overlap event get triggered when overlapping with another actor?

avatar image Jblink Apr 26 '18 at 11:13 AM

Yes, it work in play mode with the third person character

avatar image Velrin Apr 26 '18 at 11:15 AM

And the overlapped actor is found to have the "Camera" tag?

avatar image Jblink Apr 26 '18 at 11:19 AM

No, it doesn't work at all with the camera tag so I did this to test with another actoralt text

capture4.jpg (136.1 kB)
avatar image Velrin Apr 26 '18 at 11:25 AM

Did you put a break point on the play animation node to see if the overlap event is being triggered?

avatar image Jblink Apr 26 '18 at 11:28 AM

What do you mean by break point?

avatar image Velrin Apr 26 '18 at 11:31 AM

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.

avatar image Jblink Apr 26 '18 at 11:53 AM

It still doesn't work but I check Generate Overlap Events

avatar image Velrin Apr 26 '18 at 12:07 PM

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?

avatar image Velrin Apr 26 '18 at 12:12 PM

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.

avatar image Jblink Apr 26 '18 at 12:32 PM

Yes, it's checked

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

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.

more ▼

answered Apr 26 '18 at 11:17 AM

avatar image

Velrin
375 2 8 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Apr 26 '18 at 12:05 PM

avatar image

HullzAngel
66 5 5

avatar image Jblink Apr 26 '18 at 12:10 PM

I have a sphere attached to the camera because I want the door to open when the camera passed on the trigger volume

avatar image HullzAngel Apr 26 '18 at 01:15 PM

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.

avatar image Jblink Apr 26 '18 at 01:19 PM

What you mean by boolean variable?

avatar image HullzAngel Apr 26 '18 at 01:36 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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?)

more ▼

answered Apr 26 '18 at 02:52 PM

avatar image

RedLionThree
1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question