Hi all, I try to detect only collisions with PlayerAttacks tagged objects. I have added this to Detectable Tags as seen below, however it didn’t work. how can we detect such objects with tags? Is it possible to do this from the Unity UI? Else are there any code examples? Thanks!
if you want it to ignore everything else you need to set the ray layer mask to only detect the layer the “Player Attack” tag objects are on (i.e. the tagged objects would need to be on their own layer)
Hello, I have created new layer and tag for each object I want to detect.
I wanted to detect above object that I have given “Assault” tag and in “PlayerAssault” layer.
it detects every attack type including others. And I also came across an issue where if I remove “Default” from the Ray Layer Mask, it does not detect any of the attacks. What might be causing the issue?
yes, it will still get blocked by anything in the same layer(s) that are set, the tags are for the agent to be able tell the objects apart but the ray is a normal ray cast and uses the same rules as they would if you coded one yourself, so you would need to put them all on different layers if you don’t want objects in front to block objects behind etc
also if default is showing as being required for it to actually detect anything then i suspect your actual collision shape is on a parent/child which is on the default layer rather than the object shown above