Hi This is something that is stumping me, I’m trying to get a box trigger to fire when the player object enters it.
However it doesn’t seem to work. I end up having to do a comparison on the name which I’m sure isn’t the correct way of doing this.
Hi This is something that is stumping me, I’m trying to get a box trigger to fire when the player object enters it.
However it doesn’t seem to work. I end up having to do a comparison on the name which I’m sure isn’t the correct way of doing this.
show full graph
Have you changed any collision settings?
No. How would that impact this?
Well stop it working totally, quite easily
I can recall having problems getting triggers to fire, most reliable thing is a collision box in a BP.
you never specified if the print string is working so it could be one of two issues that your having.
first as mentioned by ClockworkOcean you may not have the proper collision presets which would result in the overlap event not firing. to fix this select your collision box and in the details panel look for the section for collision and then look for the collision presets. if you expand the collision presets option it will show you what channels it affects. make sure that you at least overlap the channel that the other actor is. also you can go into the other actors bp say a character and look in the collision settings there to verify the collision channel (object type) they use. in the below picture you will see red arrows on things to check: the down arrow expands the options, the collision presets allows you to change how the component reacts to other components, and the object type specifies which channel this actor interacts with.
the second issue you may be having is your comparison. in your image your comparing the other actor to actor instance of a specific class, now that may work but it also may not. I don’t believe that you could use your current method to properly specify a actor reference so it would likely not ever be equal. if you were to give it a proper reference to a actor through means such as a get player character then it would work. since you want this actor to interact with other actors of a specific class then you could easily use a cast to that class. for example if you want the actor to interact with any character then you could cast to the character class before the rest of your script. a cast basically just asks does the actor object in inherit from the class im casting to, put another way it asks is the thing i have like the thing im looking for.
summary: if you want to have the actor interact with only one specific actor in the level then use your current equal method and make sure you have a reference to the actor for comparison. if you want to interact with any actor of a given class then use a cast, a cast can also work for cases where you want a single actor and don’t expect any other actors of the same class to exist.