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 Vipul-Dudharejiya · Dec 24, 2014 at 08:11 AM · instantiateprefabpoolingjerking

How to use pool to spawn object instead of instantiate?

In my racing game , when my car speed is above 80, new prefer is instantiate at the different location on the screen. this will make my game lil jerk when they came into my scene.

is there any solution about this.?

can i use pool to solve the problem?

how can i use it in my game instead of instatantiation?

plz help me...

Comment
Add comment · Show 2
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 Vipul-Dudharejiya · Dec 25, 2014 at 07:37 AM 0
Share

but my problem is not how to use pool. i can easily search out this but i can't fix jerk problem...

avatar image Vipul-Dudharejiya · Dec 29, 2014 at 10:58 AM 0
Share

ya i want to know that

2 Replies

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

Answer by Vipul-Dudharejiya · Jan 12, 2015 at 06:54 AM

hey ... i found the perfect solution for this. i have used following link to sol this issue.

[1]: https://www.assetstore.unity3d.com/cn/#!/content/19941

this is working for me...

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

Answer by kevinspawner · Dec 24, 2014 at 09:10 AM

Am not quiet sure why there is an jerk in instantiation call? Are you using Void Update or Void Fixed Update?

Try using Void Update and create a spawn points where exactly you want the Car to be spawned and also when instantiating you can create smooth effect by dividing the spawn position or offset by using co-routine.

Similar Example:

http://forum.unity3d.com/threads/simple-reusable-object-pool-help-limit-your-instantiations.76851/

Hope this helps.

Comment
Add comment · Show 7 · 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 Owen-Reynolds · Dec 24, 2014 at 04:49 PM 0
Share

In theory, if the object being Instantiated is "big" enough (piles of children, giant Start() script) and the CPU is slow enough, all the work during the Instantiate will cause you to drop a frame. Giving a small jerk. A pool would solve this, by pre-spawning the objects.

But hard to know if that's the problem (replace with balls and see if it goes away?) I've never seen an Instantiate cause a frame-drop (well, huge all-at-once particle effects.)

avatar image Vipul-Dudharejiya · Dec 25, 2014 at 07:35 AM 0
Share

I am using "void FixedUpdate()" to call the method "StartCoroutine ("OneWaySpawn");" which will instantiate the opposite car in my game...

if car graphic is higher then it will cause jerk when they comes in to the play... whats solution about this...

avatar image kevinspawner · Dec 29, 2014 at 02:51 AM 0
Share

If you use "Void Fixed Update()" it will force the physics to run in the fixed frame rate, So it will have some frame rate issues. In your case it will be jerky. I would suggest you to try to optimize the graphics, Also in "Start co-routine" try to create pool, this will optimize the performance. I would highly suggest you to use Void Update() for physics Game Objects, this should fix the problem.

avatar image Vipul-Dudharejiya · Dec 29, 2014 at 10:59 AM 0
Share

in my case, how to use pool to spawn new object into the game

avatar image kevinspawner · Dec 30, 2014 at 08:17 AM 0
Share

I have updated the answer, Check the link and it will explain you some basic pool and you can adapt it to your need.

Show more comments

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

spawn from pool only if pool has inactive gameobjects 3 Answers

instantiating vertically 2 Answers

How to Add Y Axis Offset to transform.localPosition on an Instantiated Prefab? 2 Answers

Referencing gameObject from script after Instantiate 0 Answers

Instantiating one prefab with different materials in one frame 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