Skip to main content

Character System

Characters in Poly Plaza are powerful entities that combine core Actor functionality with advanced features like customization, inventory, quests, jobs and more. They serve as the backbone for both players and NPCs.

Base Features

Since Characters inherit from Actors, they have access to all Actor features including:
  • Location & movement control
  • Rotation & scaling
  • Physics & collision
  • Mass & gravity controls

Creating Characters

SpawnCharacter

Creates a new character at the specified location.

Movement & Vision

MoveTo

Makes the character walk to a specific location using pathfinding.

LookAt

Makes the character turn to face a specific point.

Interaction System

Setting Up Interactions

Characters have a built-in interaction system with interaction zones:

Customization

EquipCloth

Customize character appearance with different clothing items:

Example: Creating a Shop NPC

Here’s a complete example of creating a merchant NPC:

Example: Creating a Wandering NPC

Best Practices

When spawning characters, ensure the Z coordinate is slightly above ground level to prevent clipping.
Keep track of your NPCs - too many characters with active AI and pathfinding can impact performance.
Use interaction bindings to create immersive NPCs that respond to player actions in meaningful ways.

Troubleshooting

Common Issues

  1. Character not spawning
    • Check if the spawn coordinates are valid
    • Ensure the location isn’t obstructed
    • Verify the Z height is appropriate
  2. Character not moving
    • Verify the destination is reachable
    • Check if pathfinding is possible to that location
    • Make sure the character isn’t blocked
  3. Interactions not working
    • Verify the interaction functions are properly bound
    • Check if the player is in range
    • Ensure the interaction zone isn’t blocked

Debug Helper

Remember, characters are what bring your Poly Plaza world to life! Use them to create vibrant, interactive environments that players will love to explore.