Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by sid4 · Nov 29, 2016 at 12:10 AM · pooling

My pooling stops after a while , please help

I have this script and it does pool I see pool in scene clone as they pool and are created, but after a while the pooling stops I want the pooling to continue forever , I do have a few instantiate scripts heres 1 of the scripts

I just cant seem to figure out how to keep the instantiating /pooling to continue

2d

   #pragma strict
  
     public var spawnFrequency: float  = 3f; // 3 seconds
 
   public var prefab: GameObject;
   var Spawns : Transform[];
 
   function Start () {
 
       //Instantiate( prefab, Spawns[Random.Range( 0, 3)].position, Spawns[3].rotation);
       if (prefab != null)
       {
          // InvokeRepeating("SpawnItem", 1.0f, 4.0f spawnFrequency);
          // Starting in 2 seconds.// a projectile will be launched every 0.3 seconds
           InvokeRepeating("SpawnItem", 3.0f, 6.0f );
       }
   }
   function SpawnItem () {
       if (prefab != null)
       {
           if (Spawns.Length >= 2)
           {
               Instantiate( prefab, Spawns[Random.Range( 2,  Spawns.Length)].position, Spawns[0].rotation);
           }
           else
           {
               Instantiate( prefab );
           }
       }
   }

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 sid4 · Nov 29, 2016 at 03:02 PM 0
Share

I keep testing it just doesn't continue

avatar image hexagonius · Nov 29, 2016 at 05:55 PM 0
Share

does the script or it's gameobject get disabled at some point?

avatar image sid4 hexagonius · Nov 29, 2016 at 06:57 PM 0
Share

not that I know of

how can I check?

avatar image hexagonius sid4 · Nov 30, 2016 at 06:26 PM 0
Share

the gameobject with this script should be active in the scene and the script itself should have its checkbox ticked. the script is simple enough that it should work on its own correctly.

0 Replies

· Add your reply
  • Sort: 

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

77 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can someone post a generic object pool script? 4 Answers

How do I set up object pooling in a 2d endless runner? (New to unity) 0 Answers

All objects spawns with the same color but their material is different! HELP! 0 Answers

Bullet not going in the direction which it is facing. 0 Answers

Please help my pool script doesnt work. 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