Skip to content

Dynamic Player Center

The Dynamic Player Center is a utility component that automatically positions a GameObject at the center point between all active players. This can be used through either the Dynamic Player Center component or the Dynamic Player Center property.

Dynamic Player Center component interface in Unity

Configuration

Position Settings

  • Offset: Vector3 value to adjust the final position
    • X: Horizontal offset
    • Y: Vertical offset
    • Z: Depth offset

Movement Settings

  • Use Smoothing: Enable for smooth transitions between positions
  • Smooth Time: Duration of the smoothing transition (in seconds)

Usage

Setup Options

  1. Add the Dynamic Player Center component to any GameObject
  2. Access through the Dynamic Player Center property in scripts

Single Instance

Only one Dynamic Player Center should exist in your scene. When using the Dynamic Player Center property, it will always reference the first instance found.

Common Use Cases

Camera Target

  • Position a shared camera to keep all players in view
  • Create a focal point for cinematics

Gameplay Mechanics

  • Spawn items at the center point between players
  • Position UI elements relative to player group

Performance

The Dynamic Player Center updates automatically as players move. Use smoothing judiciously, as it may impact performance with frequent updates.