Sprite not changing in SpriteRenderer,SpriteRenderer's sprite not changing.

Hey, so I’ve been trying to change Object’s sprite when he dies (y = -13 || 13 or when he collides with something). I can change the sprite in the sprite renderer manually just fine, but when I try to do it in game or trough code it just doesn’t do anything. Also there are no errors and I triple checked everything.
207220-image-2023-05-14-222428341.png
Any help?

I would put a debug log in your if condition to see if it triggers.

1 Answer

1

Hi ,SimplyDamian
You have written
rend.sprite = aliveBirdSprite:: in Update function so it sets your sprite to aliveBirdSprite on every frame. Moving this line of code to Start() should work.
Hope this helps and feel free to ask if you have any questions about my answer.