Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by MrMatijs · Mar 10, 2014 at 07:01 PM · movementrigidbodytransformwindowminimize

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Sildaekar · Mar 10, 2014 at 07:13 PM

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

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MrMatijs · Mar 10, 2014 at 07:32 PM 0
Share

Thanks alot, i'll check this out if there is no other way, cause I dont want everything to be server side. Is there a way to see like: If window is closed then... ?

avatar image Sildaekar · Mar 10, 2014 at 07:41 PM 0
Share

Here are a few other topics I found that should point you in the right direction to detect if the application is being closed:

http://answers.unity3d.com/questions/54674/is-there-a-way-to-know-when-the-application-is-in.html

http://answers.unity3d.com/questions/224215/how-to-detect-in-ondestroy-if-scene-is-closinggame.html

http://answers.unity3d.com/questions/167984/call-a-function-when-app-exits.html

If this answers your questions please don't forget to mark this answer :)

avatar image MrMatijs · Mar 10, 2014 at 07:57 PM 1
Share

Yeah, thats what I need, thanks

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Npc Movement 0 Answers

stop vehicle from moving through walls 1 Answer

Player movement in the direction of rotation INACCURATE? 3 Answers

How to drag and drop a instantiate prefab on my mobile game 3D using touchs! 0 Answers

Instantiated projectile always floats up 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges