# How can I maintain multiplayer game state in Unity?

**URL:** <https://forum.heroiclabs.com/t/how-can-i-maintain-multiplayer-game-state-in-unity/1626>\
**Category:** Game Design\
**Tags:** server-framework, sdk-unity\
**Created:** [May 9, 2021, 5:30pm UTC](https://forum.heroiclabs.com/t/how-can-i-maintain-multiplayer-game-state-in-unity/1626 "2021-05-09T17:30:45Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Mohammed](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Mohammed](https://forum.heroiclabs.com/u/Mohammed)\
**Post date:** [May 9, 2021, 6:33pm UTC](https://forum.heroiclabs.com/t/how-can-i-maintain-multiplayer-game-state-in-unity/1626/6 "2021-05-09T18:33:22Z")

</div>

@srirampandiyan115  
I will try to make my explanation easy and not very technical

Lua and Javascript  
(+) It will guard against poor programming that could cause `"index out of range"` and other kinds of error that cause a panic in your code.  
(-) **Relatively** slower than go (this doesn’t mean it is SLOW)  
(-) some features are not available (will be added soon, like process events but you still can use go for that part)

Go  
(-) if you don’t make hight quality code you can crash your server (you need testing skills)  
(+) performance better than LUA & Javascript  
(+) more features as the server built in Go

Side notes: you can not call go function from lua or Javascript and vice versa, check below for more about this

> [@Call Go function from Lua](https://forum.heroiclabs.com/t/call-go-function-from-lua/1052/2):
>
> @Mohammed develop my game using Lua, but I faced some limitations and I had to use golang I’m curious what limitations did you encounter where you need to mix in some Go code to the project. Is It possible for Lua to trigger Go functions and vice versa. It’s not possible to call into functions between the two languages; this would be very complex to provide support for as you can imagine. You could have some of your logic in Lua and other parts in Go. We have lots of game teams who have…

for more about the difference between LUA & GO

> [@Nakama server multiplayer questions](https://forum.heroiclabs.com/t/nakama-server-multiplayer-questions/248/6):
>
> @HashtagGo In this case you shouldn’t use the Go runtime and instead use the Lua runtime support we have in the server. It will guard against poor programming that could cause "index out of range" and other kinds of error that cause a panic in your code. The Lua runtime uses a VM per multiplayer match (and therefore only a single Lua VM instance and its associated goroutine are lost). The Go runtime is intentionally designed to squeeze maximum performance out of the server. This is much like ze…

To learn Nakama I suggest to read the full documentation (it may take you a day or less but you will benefit more and you will understand the things discussed in the forum)

---

_[View the full topic](https://forum.heroiclabs.com/t/how-can-i-maintain-multiplayer-game-state-in-unity/1626)._
