• 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 tayloreichhorst · Aug 07, 2015 at 01:59 PM · rigidbody2dphysics2dkinematicinterpolationinterpolate

Interpolation issue, some items not being interpolated correctly.

I have a game in w$$anonymous$$ch you break through obstacles and the obstacle parts separate into physics based pieces.

All of the pieces are contained in the parent object, they all have rigidbody2d on them, set as kinematic and no interpolation. Once they break apart, I turn off kinematic and turn on interpolation for smooth movement. T$$anonymous$$s works great right now and the game is running amazingly with a lot of obstacles on screen.

The problem is, when there is a lot of obstacles, and a few of them are broken apart, some of the pieces are very jittery and act as though they are not being interpolated, w$$anonymous$$le some (even from the same parent) are smooth as butter.

I wonder if t$$anonymous$$s is an interpolation restriction, like maybe only a certain number of t$$anonymous$$ngs are meant to ever be interpolated at a time?

Here is the code I'm using.

 void OnTriggerEnter2D (Collider2D col) {
                    if (col.tag == "Shockwave" && gameObject.tag != "Transition") {
     
                 if (spin != null) {
                     spin.spinning = false;
                 }
     
                 if (!isShard) {
                     obstacleCol.enabled = false;
                     objDespawn.enabled = false;
                     SeparateObject ();
                 } else {
                     obstacleCol.isTrigger = false;
                 }
     
                 worldStats.totalObstaclesDestroyed ++;
             }
     
             if (col.tag == "Blast" && gameObject.tag != "Transition") {
     
                 if (spin != null) {
                     spin.spinning = false;
                 }
     
                 if (!isShard) {
                     obstacleCol.enabled = false;
                     objDespawn.enabled = false;
                     SeparateObject ();
                 } else {
                     obstacleCol.isTrigger = false;
                 }
     
                 worldStats.totalObstaclesDestroyed ++;
             }
     }
 
 
 void SeparateObject ()
     {
         foreach (Transform shard in shards) {
             if (shard.GetComponent<Collider2D> ()) {
                 shard.GetComponent<Collider2D> ().enabled = true;
             }
             
             if (shard.GetComponent<Rigidbody2D> ()) {
                 Rigidbody2D rb = shard.GetComponent<Rigidbody2D> ();
                 rb.isKinematic = false;
                 rb.interpolation = RigidbodyInterpolation2D.Interpolate;
             }
         }
     }





Comment
Add comment · Show 6
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 dsmeathers · Aug 07, 2015 at 07:06 PM 0
Share
avatar image tayloreichhorst · Aug 07, 2015 at 07:32 PM 0
Share
avatar image dsmeathers · Aug 07, 2015 at 08:33 PM 0
Share
avatar image tayloreichhorst · Aug 18, 2015 at 03:00 AM 0
Share
avatar image dsmeathers · Aug 18, 2015 at 02:45 PM 0
Share
Show more comments

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

24 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

Related Questions

[Video] 2D hinge joints not working. 1 Answer

Rigidbody 2D with interpolate = cant rotate object 0 Answers

How do I Spawn an Object on a Seafloor Randomly? 0 Answers

The character velocity changes while the rigidbody is kinematic 1 Answer

Random 2D Jumping With rigidbody2D.AddForce 1 Answer


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