Keep moving when window is minimized

This is my little code:

rigidbody.transform.position += rigidbody.transform.right * speed * Time.deltaTime;

So this will move the transform forward, constantly, but when I minimize the screen, or even close it, it will stop moving, I want to know how to make it so it keeps moving forward even when the window is minimized or closed (closed because this is multiplayer).

Thanks in advance.

Matijs

I’m not sure how to make it keep moving when the window is minimized, but this is NOT possible to do via client side when the window is closed. When a program is closed the stack is erased and all objects are removed from memory.

Your best bet would be to create an Authoritive Server (where the server controls everything and the client just tells it what’s going on with them). Then on the server you could have objects continuing to move.

Check out these links:

http://forum.unity3d.com/threads/112430-Authoritative-server-example-demo

http://playblack.net/zee-code/unity-3d-authoritative-server-networking-pt1

http://forum.unity3d.com/threads/199538-Tips-for-server-authoritative-player-movement

http://forum.unity3d.com/threads/136561-Networking-Tutorial