Question by
Gunnarinator · Jan 08, 2019 at 04:22 PM ·
spritespriterenderer
SpriteRenderer not changing the sprite?
I'm trying to make a JRPG and whenever I enter combat, I tell two gameobjects with spriterenderers to render the sprites of the enemies, but they don't... everything else in combat works: people take damage, the healthbars show up, etc.
I'm using these lines of code:
GameObject.Find("Enemy1").GetComponent().sprite = Enemy1Sprite;
Enemy1 is the name of the gameobject with the sprite renderer, and Enemy1Sprite is a public field of the combat managing gameobject, which is filled in with the appropriate sprite
Comment