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.
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
- Add the
Dynamic Player Center
component to any GameObject - 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.