How to make a Trigger Box fire to Character only? I already try this method but it’s doesn’t work
my DefaultPawnClass is already ThirdPersonCharacter, do I need to change it?
Thanks
How to make a Trigger Box fire to Character only? I already try this method but it’s doesn’t work
my DefaultPawnClass is already ThirdPersonCharacter, do I need to change it?
Thanks
You appear to be a little confused by what you’re checking for. At the moment, it is expecting a reference to a specific actor/object. You will either want to get a reference to the player character and use that, or you could perform a class check, like so:
yeeah because I already search on the internet and I found nothing
I following your way to perform a class check but it still doesn’t work
thanks for your reply anyway
Ah, sorry. Try this instead!
The one I suggested will only fire if an actor of the exact class triggers the overlap. This should work for any class/ Blueprint inherited from the class.
Image Source: : How to check if an actor is from a certain class? - Programming & Scripting - Unreal Engine Forums
Another Way to do this is to use the actor tag.
You have to assign a tag to the actor inside the editor or the blueprint class.
The advantage of this method is the possibility to swap the player (You have only to assign tag Player or whatever you use to the interessed pawn)
There is another solution which is more complicated, but also can help in long term development.
First go to Project Settings → Engine → Collision and add a new object channel
Then go through all the current presets and change the trace type Player to the same as Pawn trace type.
Now create a new Preset and name it as you like (for example: SpecificTrigger)
Change the collision preset of your trigger (or anything you like) to the new one
In your player character change its object type to Player type
Now you are good to go.
■■■■ man I’m so sorry, the first way you gave me is actually work, it’s my fault I change the Collision Preset to Pawn, and then I change it to default (Trigger) now it works
Thank you
yes Actually I only need it for 1 Trigger Box but actually it works now (thanks to Greywacke)
Anyway of course thank you for your answer I’m sure this will helpfull in the future