How do I make a player only overlap event?
What I'm trying to do is making an overlap even so only the player can trigger the overlap event because right now any object that's set to generate overlap events will trigger this overlap event. So I've set up an overlap event which uses a variable to make a player only overlap event. The variable is an object reference to the first person character object which is the player. It looks like this:
What's happening is for some reason the blueprint keeps on activating even when I'm not overlapping with the object. It's really weird because while it is a custom mesh, I did set the collisions and when I just use the regular overlap event it works like normal (meaning it doesn't activate when the player isn't overlapping) but when I use this node it activates even when the player isn't overlapping with the actor. So how can I fix this?
asked Nov 24 '15 at 06:51 AM in Blueprint Scripting
Not sure to completely understand but I may provide some help for your main problem : - you can use tags => tag the player pawn with "Player" and check if OtherActor has the "Player" tag - you can use cast => cast your OtherActor in the class of your pawn/player. If it succeed, it is your player. But be careful, if you use other pawn (like AI) - you can use collision system (I think it is the best one) to ignore/overlap/block => if you are not ease with that, I recommend you to check out this : https://www.unrealengine.com/blog/collision-filtering, and then create your custom collisions channels.
I didn't find tuto or doc but you should check in Project Settings > Collision. From here, you can make new object channels. So, in your situation, the best will be to have a new channel Player and an other one for your trigger, that will ignore everything, except the Player, that will overlap.
Hope it helps.
answered Nov 24 '15 at 09:14 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here