Change the role model||doc135491

September 20, 2022

Format

 Entity:changeActor(actorName, clearSkin) 
  • The class to which the function belongs:Entity

Description

Change the role model of an entity object.


Parameters

Variable name type Description
actorName string model name
clearSkin boolean Whether to clear the skin


Get model name

In the resource management of the character editor, we provide some model resources for creators, and creators can also create or import character resources by themselves, where we can directly get the model name


Code Samples

on the client sideglobal script, register when the client map load is completeCallback, changing the player's character model

Lib.subscribeEvent(Event.EVENT_LOAD_WORLD_END, function()
    Me:changeActor("Fire Warrior.actor")
  end)