Trigger on event end?

Is there a way to trigger something when an event ends?

I’m currently trying to set something up via blueprint interface that seems very simple to me, but I’ve been banging my head against a wall for days trying to figure it out.

All I want to do, is set a bool to true when an event is occurring, and then set it to false when the even ends.

I have objects that receive an event when they are hit by a trace, I want them to set a bool on themselves to true when they detect the event starting (that parts easy) and then set the bool to false when the event stops (trace is no longer hitting them).

Again, seems incredibly simple yet I can’t find any way to make changes based on an event ending/stopping

Any help would be appreciated.

Hi,

I cant find a node/function/variable/event related to the end of a matinee cinematic.

The last hope is to set a event in the timeline inside the matinee cutscene, but would be simpler to have a blueprint event node for this.

How do you know the matinee cinematic has ended ??!!

Howdy!

It sounds like what you are after can be accomplished by [Casting][1] to your target Blueprint instead of using an interface. I’m sure there are multiple ways to do it, but I’ve setup a way to accomplish what you are after below, have a look.

After your Trace Node, Branch to see if your Object Type defined in your trace was hit or not. If not, create and set a variable to false (this will be passed to your Blueprint who is constantly running the Boolean check later). If so, create and set a variable actor type to hold the actor who was hit (Hit Actor in my case above).

Branch again with a condition which checks for a Tag (one that you can specify in your Blueprint who is constantly running the Boolean check). If the Hit Actor has the Tag, it will be true and will set the variable to be passed on to True (If false, nothing happens at this point but you could set up other sequences if false).

Drag off the Hit Actor variable and Cast that to your Blueprint (the object running the check). Inside your Blueprint who is running the check, you can set up a Custom Event that is driven by an Event Tick or like I did below, hook the Event Tick up directly so it is constantly checking. Create your Boolan/Branch setup as desired and back in the Blueprint with the Trace, set that Boolean as shown in the first image.

Again, I’m sure there is another way to do this. Even using a Mouse Over event, but if you are doing it with Traces, this could be one way to do it.

Hope this helps!

-W

Hey Wes,

Thanks for the reply!

I’m at work at the moment so I can’t test this exact setup, but I tried something very similar and it had one glaring flaw.

If I have two objects with that blueprint right next to each other, when I go from looking at one, to the other, the first one I was looking at never notices I stopped looking at it, because the sender is still saying “yes, I’m hitting something that has this tag”.

What I’m currently trying to do is just make it so the object sees that the event is running on it, does a function (in my case, changes its material) and then changes it back to default once the event is no longer running on it.

the other solution I was playing with was maybe having my tracer always send to the last two objects it hit, that way they could compare names and see that they weren’t the current target, but I was unable to figure out how to store things in arrays, and I’m sure there’s some much easier solution.

I’m also worried about having a bunch of objects laying around that are running constant event-ticks, I’m not a programmer so I don’t actually know how bad it would be, but I would think having 10-20 of these objects around would be a significant performance hit due to all of them spamming event-ticks (again, I could be completely wrong)

Again, I haven’t tried your exact setup but I do think it will have the same flaw I mentioned above. I will try it later tonight and check back.

Thanks again!

Finally got home and had a chance to try this. At first, the exact same problem that I described occurred, when I had two objects next to each other, and looked at one and then the other, the first one never noticed I stopped looking at it.

However, in recreating your example, it helped me finally get a grasp on casting, and I was able to fix my issue by having my receiver object cast back at my player to see what actor he was currently hitting with a trace and then comparing that one with itself.

I still wonder the implications of having tons of these objects around that are all constantly looking for these variables with event-ticks, but I duplicated my target object about 200 times and nothing bad seemed to happen, so for now… I’m super happy I finally got this working!

Thanks a bunch!

So what it seems to me is there are several people trying to change the visibility to false or set the material to glass of objects hit by a raycast. Primarily with the top down BP and having items in the way. So where I currently am at is where you are at. Set it to false off when the cast hits nothing. With method when people are in buildings they will delete all of the walls because you are always hitting the ceiling. I really with that you could run something when an event completes. That seems like a very powerful tool to have at your disposal and would make the BP even stronger/ have the strength of coding.