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 adit1 · Mar 25, 2013 at 01:14 AM · 2djavascripttime

Pausing a particular game object and unpausing.

Hi, is it possible to make particular sets of game objects to pause during the game? I'm trying to do pause and unpause particular objects. Any ideas? Thank you!

Comment
Add comment · Show 4
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 robertbu · Mar 25, 2013 at 02:23 AM 0
Share

How are you moving your game objects? Rigidbody, character controller, or Translating? Are you going to have different buttons pause different things, or only a single pause for this group of game objects?

avatar image adit1 · Mar 25, 2013 at 02:35 AM 0
Share

$$anonymous$$ost of them are rigid body. Only a single pause for this group of game objects. Is there unity defined function for that? or should we have to do manually? I don't want them to update at particular point.

avatar image robertbu · Mar 25, 2013 at 02:40 AM 0
Share

There is no Unity function for this. You will have to do them individually. You will have to figure out how to communicate to these scripts that a pause is in progress...a static variable, a common script they referecne...and then have each individual object pause (or an outside script pause for them). For pausing a Rigidbody, you might try setting the is$$anonymous$$inematic flag to true.

avatar image adit1 · Mar 25, 2013 at 02:42 AM 0
Share

Oh okay. Thanks for the info!

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Nerull22 · Mar 25, 2013 at 03:33 AM

A solution to a pause for a certain group of objects is to relate their movement to time, and then set the timescale to 0. So a movement times 0 will always be zero. Shrugs I've done something like this in the past and it works pretty well, just depends on what you're doing I suppose.

Comment
Add comment · Show 2 · 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 adit1 · Mar 25, 2013 at 03:48 AM 0
Share

Not just movement, I want entire functions to shut down. For example, I want to stop updating enemies, it should stop spawning them, shooting bullets etc.

avatar image Nerull22 · Mar 25, 2013 at 06:47 AM 0
Share

All right, this may not be the only solution, but I think it may be a solution for this particular problem. You can create a class that extends $$anonymous$$onoBehaviour. And set up in the update an if statement that will only run if a certain boolean is set to true. And have another update that you create such as "Run()" that will act as your update. So...

 bool shouldRun;
 
 void Update()
 {
    if(shouldRun)
        Run();
 }
 
 void Run()
 {
    //Override this function
 }

Then all the actions that you would want the object to take on a normal running will be placed in the overriden function of Run. So then all you have to do is make a call to the inherited parents variable of shouldRun to stop it from calling that scripted data. Could even set up a global variable to do this maybe....

I'm hoping that what I have said makes sense and helps.

avatar image
0

Answer by schetty · Mar 25, 2013 at 04:43 AM

no, we cannot pause the particular object in the scene rather we can stop that functionality if you use the time scale is 0 the total scene will be pause.

Comment
Add comment · 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

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

12 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

Related Questions

How would I make a route that shows where player moves beforehand? 0 Answers

Changing material orientation dependant on mouse location? 0 Answers

Finish One Combo 1 Answer

Collision with renderer.enabled? 0 Answers

endless 2D background in Javascript 0 Answers


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