Make player not collide with specific layer or tag

matheussartori

New member
Hi Guys.

I'm trying to make the player don't collide with an specific GameObject, which is an invisible enemy.
Today, if the player walks through the invisible enemy, the player "hits" something an the invisible enemy moves.

The invisible enemy has the "InvisibleGhost" layer.

Things that i already tried:

- On the invisible enemy script, on the OnCollisionEnter, i compared the layer/tag and disabled the collision, but didn't work. I tried with the character and subcharacter layers.
- I tried to disable directly on the layer collision matrix:
1637098274017.png
- I tried to disable the collision with the InvisibleGhost layer, on the Ultimate Character Locomotion script.
1637098313735.png

I'm using the PUN addon btw, it's a multiplayer game.

Any hints of disabling the collision between this two?

Thanks!
 
UCC does its own collision detection, and as a consequence the OnCollisionEnter is never triggered for UCC characters. You have to use the CharacterLayerManager component on your player, and add the InvisibleGhost layer to the invisible layer mask. If the ghost is also a UCC character, you might have to set the Character layer to be invisible to the ghost's CharacterLayerManager. This should fix your problem.
 
UCC does its own collision detection, and as a consequence the OnCollisionEnter is never triggered for UCC characters. You have to use the CharacterLayerManager component on your player, and add the InvisibleGhost layer to the invisible layer mask. If the ghost is also a UCC character, you might have to set the Character layer to be invisible to the ghost's CharacterLayerManager. This should fix your problem.

Thanks!

I'm loving the UCC so far!
 
Top