[SOLVED] Remove sprite image with code

Hi can anyone tell me how we can remove the sprite image through code not remove the entity.Thanks🙂

Hi @Yash,

If you are using an element component do this:

this.entity.element.sprite = undefined;

Otherwise for the sprite component:

this.entity.sprite.sprite = undefined;

I think that will work, give it a try.


It works :slight_smile: thanks

1 Like