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 /
This question was closed Oct 18, 2015 at 05:09 PM by Maenor for the following reason:

Other Highly easy solution .... I'm a beginner after all xP

avatar image
0
Question by Maenor · Oct 18, 2015 at 04:24 PM · 2dprefabs

How to control the amount of Instantiated prefabs?

Hi there!! ^^ I'm trying to do a Touch to move game and thanks to the user JeevanjotSingh i figure out that i could Instantiate a Trigger Collider and set it as a "Destination" for the character, and then destroy it on contact (This last one ... is a good idea to approach the issue? Any advice on this would be totally welcome) but i'm stuck at "controlling" the quantity of prefabs .. i was thinking on using a For loop but it doesn't seems to work. What should i do? Because i am just infinitely spawning colliders xP

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

  • Sort: 
avatar image
1
Best Answer

Answer by 13yearoldceo · Oct 18, 2015 at 04:44 PM

well if i was you i would put a tag on the instantiated prefab then create a function that tracks the amount of tags in the scene like gameobject.findgameobjectswithtag[] then if your trying to limit the amount of prefabs make an if statement with the array you get from gameobject.findgameobjectswithtag[].

Comment
Add comment · Show 1 · 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 Maenor · Oct 18, 2015 at 05:08 PM 0
Share

This is so awkward! xO I was Hard-Coding everything when it was this simple!! .-. hahahha cannot believe it!! xP ... This is what how it feels to be a novice! xP

 f(mvObjectiveCount == 0 || mvObjectiveCount > 1){
                     Instantiate(moveObjective, hit.point, Quaternion.identity);
                     mvObjectiveCount++;
                 }


Follow this Question

Answers Answers and Comments

40 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

Related Questions

Help with spawning Prefabs that go towards a player 2 Answers

Use Grid Layout to set GameObjects position 0 Answers

2D: Spawning prefabs at random points above the screen? 1 Answer

Prefab Powerup works, but instantiated clone does not 1 Answer

The spacing between sprites are inconsistent 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