👾
Prodigy
  • Prodigy
  • News
  • Getting Started With Prodigy
  • How To...
    • Create Items (or anything)
    • Create Weapons
    • Create Abilities
    • Create Characters
      • Damage / Hitboxes
      • Locomotion
      • Attributes / Vitals
      • Equipment
      • Abilities / Skills
      • Enemy AI
    • Use WASD or Click To Move
  • Change Characters
  • Gamepad support
  • Design Philosophies
    • Vault - Editor, Database & Inventory
    • Attributes
    • Locomotion
    • Equipment (wip)
    • Abilities (wip)
    • Animation (wip)
  • Support & Links
    • Support
    • Get it on the Asset Store!
Powered by GitBook
On this page

Was this helpful?

Change Characters

In the Sandbox scene there is a space for changing characters on the fly. You can check out the code in the CharacterSwapTrigger class to see how this easily works.

Here's an example of how you might do this yourself:

        [AssetDropdown(typeof(ProdigyAgentDefinition))]
        public ProdigyAgentDefinition DesiredAvatar;

        public void ChangeAvatar(ProdigyPlayer player)
        {
            player.TrySetAvatarDefinition(DesiredAvatar);
            player.RequestRespawn(agent.transform.position);
        }

In the above example, it sends a request the change the ProdigyAgentDefinition that this ProdigyPlayer should be using. This just changes the preferred value, but in order to actually force the avatar to change in the world we must also respawn the ProdigyPlayer's Avatar which is done in the next line.

PreviousUse WASD or Click To MoveNextGamepad support

Last updated 3 years ago

Was this helpful?