Create, Compete & Win at Redbrick Connect 2024! 🎉
SnippetChanging Avatar Appearance

Changing Avatar Appearance


You can make the player’s avatar invisible and add another object as a child of the player to create the appearance of changing the avatar.

⚠️

Make sure to add the avatar you want to change to the scene in advance.

change_avatar
const obj = WORLD.getObject("obj");  // Object to use for the new appearance
const btn = GUI.getObject('btn');
 
btn.onClick(function() {
    PLAYER.children[0].visible = false; // Hide the player avatar
    PLAYER.add(obj); // Add the object as a child of the player
    obj.position.set(0, 0.5, 0); // Set the object's position
})