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.
Troubleshooting
Common Issues
-
Character not spawning
- Check if the spawn coordinates are valid
- Ensure the location isn’t obstructed
- Verify the Z height is appropriate
-
Character not moving
- Verify the destination is reachable
- Check if pathfinding is possible to that location
- Make sure the character isn’t blocked
-
Interactions not working
- Verify the interaction functions are properly bound
- Check if the player is in range
- Ensure the interaction zone isn’t blocked