- Home /
Hair Color
Hello Unity3D.I have a question about hair color.How i make my character change its hair color from black to white in just a click of a button?For example,My characters hair is already black.but when i like my "attack" button i want it to become white for 15 seconds and then back to black?Is there a way i can do this?If so,Can someone please tell me how it can done?Because i have been looking through the forums and i can't seem to find it.
Answer by ahgr123 · Nov 02, 2014 at 09:46 PM
You will probably need to create a script .. you will have to change material for 15 seconds and then switch it back.. use functions yieldwait.... and obuttondown (check documentation)...good tutorial how to switch materials is here..it will explain better than me..
https://www.youtube.com/watch?v=UFaPjw5zdZg&feature=youtube_gdata_player
For an alternate method you could change the texture directly, with GetPixels and SetPixels. This will affect all materials using the texture.
You could also modify the material by switching its texture.
Hmm,I will look into this tutorial right now.Thanks Guys!!!
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How to change a material in Unity 1 Answer
change a material from multiple materials 1 Answer