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 /
avatar image
0
Question by Camulos · Dec 31, 2018 at 02:54 PM · collisionphysicsprefab

Physics and prefabs

I've made a simple Airhockey game in Unity and now I want to train a ML agent to play the game. I've created a prefab that contains the complete playing area containing the field, the players and the puck and it works as intended when using only one instance of that prefab. The problem comes when we want to include multiple instances, (6+) of that prefab. Increase the instances of the prefab seems to causing glitches like the puck getting stuck.

What could be the cause of this and how do I fix it? Could it be due to the speed of the puck moving? If so, why isn't it causing problems when playing a game with only 1 instance of the prefab?

Comment
Add comment · Show 5
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 betaFlux · Dec 31, 2018 at 03:43 PM 0
Share

Do you have singletons on your prefab or on its children which you call from somewhere else? If you add more instances, does at least one of the instances work correctly and if so, is it the first or the last one added?

avatar image Camulos betaFlux · Dec 31, 2018 at 05:13 PM 0
Share

I'm not using any signletons. Second question. If it's only 1 or 2 instances, it behaves mostly normal but the more instances I add, the more unstable it becomes with the last instances added being worse than the first ones.

avatar image Bunny83 · Dec 31, 2018 at 05:26 PM 0
Share

Where do you instantiate those prefabs in the scene? Are you sure that they don't overlap and that they aren't too far from the world origin? The further away from the origin the less precision you get due to floating-point numbers

avatar image Camulos Bunny83 · Jan 02, 2019 at 08:25 AM 0
Share

I instantiate them around a path that's centered on the world origin. The farthest instance has as position -125, -10, 400

avatar image Camulos · Jan 02, 2019 at 04:06 PM 0
Share

Apperently the problem was caused due multiplying the gravity in a script connected to the puck

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Snipe76 · Jan 02, 2019 at 04:17 PM

Without any examples I can't clearly state the solution, but here are few options:

  1. You are using Transform and Rigidbody together on the puck physics.

  2. The instances are children of an object that cause them to freeze.

  3. Your pucks have more colliders that conflict with each other.

  4. Your Physics material is not set and it causes unexpected behavior.

  5. You are using the Update() function for physics instead of FixedUpdate().

Here is a link about Unity Physics: Unity Physics Practices

If you can provide some physical examples I can provide a better solution.

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

213 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 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 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

Ignoring collisions without using physics layers 1 Answer

Physics Problem :Collision(When ball moves from one ground (made of cube) to another ) 0 Answers

Rigidbodies won't collide if mass difference is too high 0 Answers

How do I solve the Box Collider (3D) Edge / Corner Collisions problem? 5 Answers

Rigidbody is behaving abnormally when transformed manually 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