- Home /
How do I change collision according to gameobject - ground color?
I am trying to build a game where I want only red objects to collide with red ground, blue objects with blue ground and green objects with green ground. So if a blue object drops on a green/red ground, it should just fall through it.
I found IgnoreLayerCollision method in the internet but couldn't get it to work. I am using FPS Character Controller's scripts for physics. Help!
Answer by Statement · Dec 27, 2013 at 07:58 PM
I'd set up the Collision Matrix for this in Physics Manager.
Create three layers called "Red", "Green" and "Blue" and set the layer accordingly on your Red, Green and Blue objects. Set up the Collision Matrix so that Red only collides with Red, Blue only with Blue, Green only with Green and so on.
If you still don't get it, I suggest that you check these links out too before asking:
If you still are stuck after reading this, let us know what part you're stuck on.
Your answer
Follow this Question
Related Questions
Material doesn't have a color property '_Color' 4 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Looking for help with differentiating collisions between game objects. 2 Answers
Detect collision/trigger between two body without rigidbody? 3 Answers
Changing a Game Object's RGBA Value on Collision (JS) 1 Answer