🏒 Get Started in 5 Minutes
Quick Start Steps
1. Create the Puck (30 seconds)
- In Unity Hierarchy: Right-click → Create Empty → Name it "Puck"
- Select Puck → Inspector → Add Component → Search for "PuckController" → Add it
- Position it at your center ice (e.g., position:
0, 0.5, 0)
- ✅ Done! Puck will auto-create its visuals and physics
2. Tag Your Players (1 minute)
- In Unity: Edit → Project Settings → Tags & Layers
- Add two new tags:
- Select all your home team player GameObjects
- In Inspector → Tag dropdown → Select "HomeTeam"
- Select all your away team player GameObjects
- In Inspector → Tag dropdown → Select "AwayTeam"
- ✅ Done!
3. Create Faceoff Manager (30 seconds)
- In Hierarchy: Right-click → Create Empty → Name it "FaceoffManager"
- Select FaceoffManager → Add Component → "FaceoffManager"
- Drag your Puck GameObject into the "Puck" field in Inspector
- ✅ Done! Manager will auto-find players by their tags
4. TEST IT! (Press Play)
- Press Play button in Unity
- Press F key on keyboard
- Watch the faceoff happen!
- Check Console for outcome messages
- ✅ If you see faceoff outcome and puck moves → SUCCESS!
What You'll See
During Faceoff:
- Console: "Faceoff starting..."
- Players freeze briefly
- Console: "Faceoff outcome: HomeWin / AwayWin / Struggle"
- Puck moves (passed to defender OR bounces loose)
- Players unfreeze
When Player Gets Puck:
- Yellow rotating ring appears around them
- Player can now shoot, pass, or carry
When Puck is Loose:
- No ring visible
- Puck slides freely on ice
- First player to get close picks it up automatically
Troubleshooting
"Nothing happens when I press F"
- Check Console for error messages
- Make sure FaceoffManager has the Puck assigned
- Verify you have players tagged HomeTeam and AwayTeam
"Puck doesn't move"
- Check that PuckController has a Rigidbody (it creates one automatically)
- Make sure puck Y position is above 0 (ice level)
"No centers found" error
- Make sure ONE player on each team has Position = "C" (Center)
- Check PlayerStats ScriptableObject for each center
"Players don't have yellow ring"
- Make sure PlayerController.Start() runs
- Check that possessionIndicator GameObject is created
- Try stopping/starting play mode
Next Steps After Testing
5. Add Debug Visualization (Optional)
- Create Empty GameObject → Name it "DebugVisualizer"
- Add Component → "PuckDebugVisualizer"
- See possession ranges, trajectories, and on-screen info
6. Auto-Position Players (Optional)
- Create Empty GameObject → Name it "FaceoffPositioning"
- Add Component → "FaceoffPositioning"
- Right-click component → "Auto-Create Faceoff Spots"
- During play: Press 1 (center), 2 (home zone), 3 (away zone)
7. Integrate with Your Game
- Add Component → "GameFlowExample" to see complete integration
- Copy the patterns you need into your own GameManager
- Use
faceoffManager.InitiateFaceoff(position) after goals, periods, etc.
Common Integration Patterns
Start game with faceoff:
void Start() {
FaceoffManager manager = FindObjectOfType<FaceoffManager>();
manager.StartFaceoff();
}
After a goal:
IEnumerator AfterGoal() {
yield return new WaitForSeconds(3f); // Celebrate
faceoffManager.StartFaceoff(); // Return to center
}
Check if player has puck:
if (player.HasPuck()) {
// Do something
}
Make player shoot:
Vector3 toGoal = (goal.position - transform.position).normalized;
player.Shoot(toGoal, 1.0f);
Test Controls
During Play Mode:
| Key |
Action |
| F |
Trigger faceoff |
| 1 |
Position for center ice faceoff |
| 2 |
Position for home zone faceoff |
| 3 |
Position for away zone faceoff |
| G |
Simulate goal (if GameFlowExample added) |
Success Checklist
After following steps 1-4, you should have:
All checked? → You're ready to go! 🎉
Need Help?
- Read the docs:
FACEOFF_SYSTEM_README.md (detailed)
- Quick reference:
QUICK_REFERENCE.md (cheat sheet)
- Check examples:
GameFlowExample.cs (integration patterns)
- Validate setup: Add
FaceoffSetupGuide component → Right-click → "Validate Setup"
What's Included
✅ PuckController - Physics-based puck with auto-pickup
✅ FaceoffManager - Complete faceoff system with 3 outcomes
✅ PlayerController - Shoot, pass, check methods
✅ Visual feedback - Yellow ring shows possession
✅ Setup tools - Auto-setup and validation
✅ Debug tools - Visualizers and on-screen info
✅ Examples - Complete game flow integration
✅ Documentation - Full guides and references
Total setup time: ~2 minutes
Ready for testing immediately!
Press F to faceoff! 🏒