- Home /
Cube collision with different materials
I have a question that I still cannot resolve, for example I have a cube with a different material or color on each of its faces and when colliding with another object the answer is different based on the material or color that the collision can recognize. Help, I'm getting started in Unity
Answer by vertexx · Mar 05, 2021 at 01:47 AM
Not sure what the question is..But material will certainly affect collisions. Best to maybe keep to a single material if you want a constant outcome. BUT..that might not be the question? Is it that you need advice on how to assign different materials/colours to a cube? EDIT. You are talking about physics material?
Thanks for answering. I tell you the cube is a model that I made in Blender where the mesh is divided with a material for each face. What I need since the cube has a different color on each face, when another object collides with it, it has an action according to the color that identifies the collision or for example the other object has the same color of the face with which it is colliding.
Hi. Sounds ok. My quick and dirty answer... gulp..is this.. Just select your cube. Add six box collider components. scale and place each collider so it is aligned with the cube face, that is...one collider for the top..one for the bottom...etc... Assign each collider it's physics material.. You may need to look in the Store for some free physics materials. That should do it. To test just add a primitive sphere with a rigid body and a collider and "drop" it onto your NEW cube. Try rotating the cube to test it's various material outcome. Probably a much easier way somewhere out there. But worth a try.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to render a lot of the same small objects 2 Answers
Mesh Collider on a 2D mesh creating a 3D box? 0 Answers
Saving colors of multiple mesheseach having multiple materals 0 Answers
Colour cubes after CombineMesh() 0 Answers