I have one plane with a png(with transparency) texture on it. Exe: rock.
I want to make a mesh collider that fits exactly with the png(rock). Not the plane.
I made the rock collider mesh in 3D Max, export it to FBX, imported to Unity.
There in the Project/prefabs i have the mesh(with the import settings) and Box001 witch is the actual collider.
When i select my plane and put a mesh collider, i can select Box001 from the menu, but is too large…i need to scale it(because my plane is also scaled).
Any ideas pls? Pls ask if i didn’t make my self clear.
This might be really too late but you can try this:
// Given you are building your quad programmatically
public MeshFilter meshFilter; // Drag the MeshFilter from the game object's inspector.
public MeshCollider meshCollider; // Drag the game object to get the MeshCollider in the inspector.
void Start()
{
meshFileter.mesh.vertices = yourCustomVertices;
gameObject.AddComponent<MeshCollider>();
gameObject.GetComponent<MeshCollider>().sharedMesh = meshFilter.mesh;
meshCollider = gameObject.GetComponent<MeshCollider>();
}
Replace the mesh collider with a box collider then resize the collider to fit the rock. You can also re position the collider to make it fit, if your rock isn’t dead center. Hope that helps