I am creating a simple 2D door, when i stand in my trigger, i want it to open by switching texture from the open door texture to the closed one. I got it working with an animator where i had the transition between the textures occur when i entered and left the trigger area, but i wanted too see if it’s possible to achieve the same result with script only. I do not want to do it with 2 GameObjects however, i got that working too by toggling the enable on the spriteRenderer.
Is there anyone who can help me?
I’m pretty new to coding, but I have searched everywhere and not found a single solution that matches what i want.