- Home /
Question by
berkanmusellim · Sep 02, 2018 at 05:11 PM ·
meshplayerobjectmeshcollider
Changing Mesh and Mesh Collider of an Object
Hello,
I am trying change Mesh and Mesh Collider of an Object. But somehow after changing the mesh, object is disappearing.
opponentSpaceShip.GetComponent<MeshFilter>().mesh = playerShipMeshes[_playerShipChoice_];
opponentSpaceShip.GetComponent<MeshCollider>().sharedMesh = playerShipMeshes[_playerShipChoice_];
This is my two line code where I try to change Mesh. I have an Mesh array, which basically holds Meshes. I have already set the Meshes. And I have an integer playerShipChoice which indicates the prefered mesh in the array.
Anybody know whay may caused this?
Comment