Im using similar method but for my game, but my game is a multiplayer so its a bit more complicated...