Making player transparent and going through obstacles

How do I make my player transparent, go through obstacles without touching them for 10secs. I am working on a powerup But kind of confused.

I think you can deactivate the collider for this.

Disabling the colliders can work, but if there’s a rigidbody with physics, the player will fall through the floor, too. What you can do is to put the walls on a layer called, say, ‘Walls’ and the floor on a layer called, ‘Floor’. Then, make another layer called ‘Special’ (or whatever) and go to the project settings. Under physics, set the ‘Special’ layer to not collide with ‘Walls’ but to still collide with ‘Floor’.

image

Now, when the player gets the powerup, move it to the ‘Special’ layer. When done, move it back to the original layer. You’d only need to change the object with the colliders.

1 Like

Privacy & Terms