in 15:00 actually you can use modulo and division so the script is less line and flexible. so when there are changing. you only need change few line. like this // -------------------------------- // code start here if ((int)(100 * flashCounter / 16) % 2 == 0) { playerSprite.color = new Color(1f, 1f, 1f, 0f); } else { playerSprite.color = new Color(1f, 1f, 1f, 1f); } if (flashCounter
I had difficulty with an error coming up that read - "'Color' does not contain a constructor that takes 5 arguments" because I made an error and had 5 arguments when specifying 'new Color' after googling around a bit, I replaced each instance of {playerSprite.color = new Color(playerSprite.color.r, playerSprite.color.g, playerSprite.color.b, 1f,);} with {playerSprite.color = new Color(1,1,1,1);} and that worked for me. I also zeroed the G and B channels with {playerSprite.color = new Color(1,0,0,1);} during flash, so that he would flash red instead of clear.
Hi there, if you're following along with this tutorial series, at this point respawning has not been set up yet and after your player dies the game mode screen should be 'stuck'
omg that was perfect, amazing work thank you .
in 15:00 actually you can use modulo and division so the script is less line and flexible.
so when there are changing. you only need change few line. like this
// --------------------------------
// code start here
if ((int)(100 * flashCounter / 16) % 2 == 0)
{ playerSprite.color = new Color(1f, 1f, 1f, 0f); }
else
{ playerSprite.color = new Color(1f, 1f, 1f, 1f); }
if (flashCounter
I had difficulty with an error coming up that read - "'Color' does not contain a constructor that takes 5 arguments" because I made an error and had 5 arguments when specifying 'new Color' after googling around a bit, I replaced each instance of {playerSprite.color = new Color(playerSprite.color.r, playerSprite.color.g, playerSprite.color.b, 1f,);} with {playerSprite.color = new Color(1,1,1,1);} and that worked for me. I also zeroed the G and B channels with {playerSprite.color = new Color(1,0,0,1);} during flash, so that he would flash red instead of clear.
It won’t respawn
same
Hi there, if you're following along with this tutorial series, at this point respawning has not been set up yet and after your player dies the game mode screen should be 'stuck'