- Home /
change material upon collision
I am trying to change object material upon collision with FPSController. Found many examples were script is changing material colour/texture, but both materials I have are totally different and I want to switch between them every time I collide with that exact object. How is this possible?
Answer by tormentoarmagedoom · Jun 16, 2018 at 12:47 AM
Good day.
you need to learn about OnTriggerEnter collisions detection.
And please, try to be accurate, texture is not the same as material. I supose you want to change the material.
GetComponent<MeshRenderer>().material = Your_material;
Bye. :D
I will reward you all my 41 points if you could write that for me. I would do it myself, but I can't.
Bye. :D
Your answer
![](https://koobas.hobune.stream/wayback/20220612164839im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
(Answered)Objects Spawning In Pink? 0 Answers
Query renderer.materials in prefabs in Editor without changing to instance 2 Answers
UGUI button gray shader 1 Answer
How can I use a shader to tint a greyscale texture with a skin tone... 0 Answers
Is it possible to make an image sequence into an animated normal map? 0 Answers