fix metallic property when spawning object
This commit is contained in:
parent
d7fec73c77
commit
191c9e66fe
@ -33,7 +33,7 @@ public class ModelGenerationPipelineStarter : MonoBehaviour
|
|||||||
meshRenderer.material = activeMaterial;
|
meshRenderer.material = activeMaterial;
|
||||||
|
|
||||||
StartModeGenerationPipeline();
|
StartModeGenerationPipeline();
|
||||||
//LoadModel("D:\\henrisel\\DeltaVR3DModelGeneration\\3d-generation-pipeline\\models\\2025-11-02-17-03-37\\0\\mesh.glb");
|
//LoadModel("D:\\henrisel\\DeltaVR3DModelGeneration\\3d-generation-pipeline\\models\\2025-11-17-16-13-33\\mesh.glb");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,8 +131,12 @@ public class ModelGenerationPipelineStarter : MonoBehaviour
|
|||||||
|
|
||||||
|
|
||||||
Transform spawnedObjectMainTransform = spawnedObject.transform.GetChild(0).transform;
|
Transform spawnedObjectMainTransform = spawnedObject.transform.GetChild(0).transform;
|
||||||
MeshCollider collider = spawnedObjectMainTransform.GetChild(0).transform.gameObject.AddComponent<MeshCollider>();
|
GameObject spawnedObjectBody = spawnedObjectMainTransform.GetChild(0).transform.gameObject;
|
||||||
|
MeshCollider collider = spawnedObjectBody.AddComponent<MeshCollider>();
|
||||||
collider.convex = true;
|
collider.convex = true;
|
||||||
|
MeshRenderer renderer = spawnedObjectBody.GetComponent<MeshRenderer>();
|
||||||
|
renderer.material.SetFloat("metallicFactor", 0);
|
||||||
|
|
||||||
spawnedObjectMainTransform.gameObject.AddComponent<Rigidbody>();
|
spawnedObjectMainTransform.gameObject.AddComponent<Rigidbody>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user