- Home /
Question asks others to write their script for them.
Enemy Color Change Help!
Hi! I am making a game but i have a problem... How can i for example if i have one cube that collides with the other cube (the enemy), how can i make the enemy turn color to red for a second then it turns back to its original color (white)? Paste the code in the comments and THANK YOU!
I was about to keep that one off the since it is already existing many times.
I closed after we answered because he has made no attempt to solve it himself.
We gave him some breadcrumbs,, he should follow them and see where they lead.
Answer by Jeff-Kesselman · Nov 17, 2014 at 03:38 PM
We don't write code for you here and posts that ask for complete scripts are generally rejected.
To change color you need to set the renderer.material,color field see: http://docs.unity3d.com/ScriptReference/Material-color.html
For a delayed effect you can use the Invoke method with a time delay. http://docs.unity3d.com/ScriptReference/MonoBehaviour.Invoke.html
Try to write your script yourself and, if you cannot get it to work, post what you tried here along with an expaination of what went wrong and the complete text of any unity errors.
Follow this Question
Related Questions
Enemy gets through wall over time, colliders working. 1 Answer
How can I make my enemy stay on the ground and collide with other objects? 2 Answers
enemy awareness with colliders? 1 Answer
How can I more optimize My AI Script 0 Answers
How do I stop an Enemy NavMeshAgent from intersecting the player model? 3 Answers