I’m trying to do when specific keyboard input is pressed, the Sprite should be replaced with other Sprite of my choice. I was searching in API reference but I might missed something.
Can anyone point me to specific part of API documentation?
I’m trying to do when specific keyboard input is pressed, the Sprite should be replaced with other Sprite of my choice. I was searching in API reference but I might missed something.
Can anyone point me to specific part of API documentation?
Quick example made here: https://playcanvas.com/editor/scene/1129019
Please space to change the sprite.
Ok that what I need but if I have nested entity how to call that entity? Example of hiearchy of entity in next photo.
Ok, I found the answer to my question
It needs to be like this
this.player = this.entity.findByName('Player');
this.player.sprite.spriteAsset = this.sprite_right;