Both players were seeing the same UI. The Ready button behaved strangely. That’s when I knew my multiplayer logic was wrong.
This post is part of my daily learning journey in game development.
I’m sharing what I learn each day — the basics, the confusion, and the real progress — from the perspective of a beginner.
On Day 53 of my game development journey, I learned how to properly identify players in multiplayer using PlayerState.
What I tried / learned today
At first, I tried storing PlayerController IDs inside an array to identify players. That approach failed.
I learned that PlayerController is not reliable for multiplayer identity logic, especially when dealing with server and clients.
Then I explored:
- Local PlayerState
- Owning PlayerState
I understood that PlayerState exists on both the server and clients and is designed to store multiplayer-related data like player name, score, and status.
Instead of using Controller IDs, I used PlayerState to identify each player.
Using PlayerState, I controlled:
- Ready button visibility
- Player-specific UI behavior
Because PlayerState replicates properly, the logic finally behaved as expected.
What confused me
I was confused about:
- Why controller ID logic kept failing
- The real difference between PlayerController and PlayerState
- Why the UI looked identical for all players
- Local vs server ownership
Multiplayer ownership felt complicated at first.
What worked or finally clicked
The big realization was this:
PlayerState is built specifically for multiplayer identity.
I understood that:
- PlayerControllers can exist differently on server and clients
- PlayerState handles replicated player data
- UI must check for the locally controlled player
Once I used Owning PlayerState correctly, everything became stable.
An interesting fact I learned:
Even if a PlayerController is destroyed and recreated during travel, PlayerState can persist and keep important player data, which is why it’s so important in multiplayer systems.
One lesson for beginners
- Use PlayerState for multiplayer data
- Avoid storing Controller IDs manually
- Check Is Locally Controlled when needed
- Keep UI logic client-side
- Replication settings matter a lot
Multiplayer logic is not about guessing — it’s about understanding ownership.
Slow progress — but I’m building a strong foundation.
If you’re also learning game development,
what was the first thing that confused you when you started?
See you in the next post 🎮🚀
Top comments (0)