samedi 2 mai 2020

How to change the color of a sphere after crossing a cube in Unity 3D?

I am new Unity3D, I really love it, and when I started my project, I have a problem, I have a sphere which it moves by (AddForce), and I put a Material to it which is (red), I want from that sphere after crossing a cube which it is on (isTrigger) mode and not visible is:

1) Change the color of the sphere to (blue or red).

2) To Start the sphere into a random color (blue or red).

3) If I can put a Hex color, It would be better, but if it a solid color, no problem.

4) If the random color = to cube 1 color it will continue moving, else: random color != to cube 1 it will stop moving, you could say that it is an obstacle.

I really believe that it wants coding, but I only know Python, so if you can write for me the code to understand it better, And I hope that you help me ASAP I would appreciate that, thank you veryyyy much!

If there is any question, Please tell me.




Aucun commentaire:

Enregistrer un commentaire