Topdown 2D RPG In Unity - 17 Hurt Flash

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 6

  • @hibamateur3897
    @hibamateur3897 4 роки тому +3

    omg that was perfect, amazing work thank you .

  • @ganipra7402
    @ganipra7402 4 роки тому +3

    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

  • @Meanie010
    @Meanie010 3 роки тому

    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.

  • @etgan1844
    @etgan1844 4 роки тому +1

    It won’t respawn

    • @Guy0904
      @Guy0904 4 роки тому

      same

    • @babyapeescape
      @babyapeescape 4 роки тому +4

      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'