Download

Trigger Volume is not triggering.

I’m following along with this Unreal tutorial up on YouTube. It’s part 3.
I’ve been trying to follow it along exactly but there are some differences I’ve noticed.

This first one is MY PB.

This is HIS BP.

HisBP.jpg

I’m assuming it’s new features in Unreal between the two versions. If I use the BeginPlay event to toggle my light, it works… However, if I try to use my Trigger Volume overlap event, I’m not getting the event to trigger…

I have ensured that I’m outside the volume at start, I then move into the volume and nothing happens. On my Trigger Volume, I set Generate Overlap Events to true, nothing happens. On my “Player Start” I’ve set Generate Overlap Events During Level Streaming (which I’m not sure is actually needed, but tried it anyway). Nothing happened.

I know the actual toggle is working, cuz it works when I wire up the Begin Play event…

Hoping someone might have some suggestions on what I could try…

Thanks so much!!!

Rick

Hey Rick!

Have you tried casting to your player character BP and plugging the other “object input” of the trigger volume into the character BP’s “object” input?

Also check to see what your trigger volume’s collision preset is set to. Try setting it to OverlapOnlyPawn if you haven’t already.

Hi Jon…

I think I was able to duplicate what you were suggesting. I had been watching another video tutorial earlier in the day which helped to figure out how to do the cast… Here is my new BP after that change AND the trigger settings. However, I’m not seeing any changes… It still is not triggering.

I greatly appreciate your help. I’m ramping up on UE4 after being in the Unity world for several years. :slight_smile:

TriggerSettings.PNG

As a note, I tried taking the execution path from the OnActorBeginOverlap event directly to the Toggle Visibility function, that didn’t seem to work either.

@RickBlacker You need to cast to player pawn or player character, not player start. The cast is to get what is actually doing the overlapping. It’s never going to be the player start :wink:

Hey Rick!

As ClockworkOcean mentioned you don’t want to cast to the player start, but your character. I suggested the character BP if you have one, but you can also try casting to a player controller. =)

Hi ClockworkOcean, Jon…

Makes perfect sense.

I’m doing this all within the Unreal Starter Map (content).
I’m not getting CastToPlayerPawn or CastToPlayerCharacter. From what I can tell, there hasn’t been any kind of “Player” setup other than the player start location.

Coming from Unity, my first gut instinct is to go create a FirstPersonCharacter (rather import Unreal’s), which I have done. No I just need to go figure out how to make wire it up so it moves and my camera is the camera on the first person, not the default one that’s already in the level.

There is probably an easier approach to this, but… I don’t know what I don’t know. :smiley:

For some reason I was not able to use a Blank project with the Unreal Starter content and bringing in the FPC. So, I started with a brand new project based on the FPS template. Again, it seems like there may have been an easier approach to this without having to use the FPC pack.

I’d REALLY like to know how come I was never able to get the FPC to work with the Starter Content and the Default Level that comes with it.

Anyway, here is my working BP based on the FPS template. This is the Level BP.

This brings up a question. How do I know when I need to “Cast To” something? I’m a software engineer, so when I think of casting, I think of things like casting a float to an int etc…
But this seems a little odd to me. Couldn’t I have just dropped in a FirstPersonCharacter? What exactly is the “Cast” doing? Is the cast really just filtering on what can trigger the event?

Yes, the code above is acting like a filter… Trapping on an object that you want the Event to respond to. What you’re familiar with is simple-casting that extended out of C into object oriented programming (OOP). In BP, a cast acts as a kind of typeof check to access OOP members…

@RickBlacker Rick, you need to back up a lot, and just start with basic starter content again. The reason you’re not seeing the right cast items / nodes, is that the nodes available change a lot depending on where your BP is. Level BP will have different nodes available to, for instance, BP you have made from an object.

If you’ve made a project using FP, you don’t need to setup anything else, it’s all in there.

Also, to be clear, you don’t need the cast to get the overlap to work. The cast is there for 2 reasons:

  1. To check the thing overlapping IS actually your player, and not something else

  2. To get a handle on the overlapping object for code which follows

You can get the overlap working without the cast.

Have you copied his steps exactly ( are you using the same volume etc, do you have it selected when you right click in the BP to make the overlap? )

[quote=“ClockworkOcean, post:10, topic:126557”]

@RickBlacker Rick, you need to back up a lot, and just start with basic starter content again. The reason you’re not seeing the right cast items / nodes, is that the nodes available change a lot depending on where your BP is. Level BP will have different nodes available to, for instance, BP you have made from an object.

[QUOTE]
Yes, I understand that they are context sensitive.

My original project was a blank project that just used the Starter Content. I tried to add FPS to it, which I was unsuccessful. I could not get the FP Character to work, the game always wanted to use the default camera/setup. So I ended up creating a brand new project based in FPS. From there I was able to go in and make the triggers work and all that.

I did this based on the suggestion I had received.

Yes, as best as I could. My initial thought was, maybe it was because of UE version differences. The video’s I was watching which are on the UE YouTube channel date back to 2014.

Thanks ClockworkOcean for your feedback. Greatly appreciated!

Rick

@RickBlacker ‘YouTube channel date back to 2014’, you could be right here, I recall having problems with this exact thing.

Can’t give you ‘direct’ advice right now, as not at a machine, but would recommend this guy, if you’ve not check him out:
https://youtube.com/watch?v=qxFa6b0mHmM
Hope to help… :smiley:

Casting usually happens when you need two separate blueprints to communicate with each other. For example if you need to get a variable from your Player Blueprint to plug into your character’s Animation Blueprint to drive your animations.

As Clockwork mentioned, you don’t necessarily need to cast to your player BP, or controller to get the overlap to work. I’m not sure if you checked what the collision was set to for your trigger, but you can usually filter it through there as well. Reason I mentioned specifically casting to your BP is because sometimes depending on the version UE4 can be pretty buggy with trigger volumes automatically triggering even if nothing is going through it. I eventually had to do a similar setup to the one I described to you in order to prevent that from happening, along with a few other tweaks.

What @SE_JonF says is correct though, once you get it working, then you need the cast. Otherwise all sorts of stuff will be causing overlaps…

Makes perfect since about the Cast. I greatly appreciate the help guys!

Happy to help. Good luck! =)

Casting should only be used if you want to directly impact the object you are casting to, like changing variables in it or making it run a function.

If you only want to compare to that object, just use a == node. Casting is far more impactful to performance and on larger projects, you’re going to want to optimise everything as much as possible. On smaller projects it won’t make a difference.

Very good to know Dan! I appreciate the tip! Do, you by chance happen to have an example you could share with me? :slight_smile: