Introduction
The Actor system is what brings your Poly Plaza world to life! Every object in the game - from characters to buildings to items - is an Actor. This guide will show you how to control them.Core Methods
Basic Information
GetName()
Returns the name of the Actor.GetClassName()
Returns the class type of the Actor.Location & Movement
GetLocation()
Returns the Actor’s current position in the world.SetLocation(position)
Moves the Actor to a new position.Rotation Control
GetRotation()
Gets the Actor’s current rotation.SetRotation(rotation)
Sets the Actor’s rotation.Scale & Size
GetScale()
Returns the Actor’s current scale.Physics Controls
SetPhysicsEnabled(enable)
Enables or disables physics simulation.GetPhysicsEnabled()
Checks if physics is enabled.SetCollisionEnabled(enable)
Enables or disables collision detection.GetCollisionEnabled()
Checks if collision is enabled.Physics Properties
GetMass()
Gets the Actor’s mass in kilograms.SetMass(mass)
Sets the Actor’s mass.GetGravity()
Checks if gravity affects this Actor.SetGravity(enable)
Enables or disables gravity for this Actor.Physics Forces
AddImpulse(force)
Applies an instant force to the Actor.GetVelocity()
Gets the Actor’s current velocity.Actor Lifecycle
Destroy()
Removes the Actor from the world.Advanced Examples
Creating a Physics Playground
Creating a Floating Display Item
Best Practices
Always check if your actor still exists before calling methods on it:
Troubleshooting
Common Issues
-
Actor not moving with AddImpulse
- Check if physics is enabled
- Verify the mass isn’t too high
- Make sure gravity is appropriate for your needs
-
Collision not working
- Confirm collision is enabled
- Check if physics is enabled
- Verify the actor has a valid collision shape
-
Actor disappearing
- Make sure the location is within valid world bounds
- Check if it was accidentally destroyed
- Verify it hasn’t fallen through the world (check Z position)