Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Troubleshooting with HingeJoint2D

Discussion in '2D' started by Themandunord, Jul 21, 2014.

  1. Themandunord

    Themandunord

    Joined:
    Jul 7, 2014
    Posts:
    11
    Hello,

    I have a problem problem to make a chain with HingeJoint2D. I follow the tutoriel of unity2D to make it, but I don't succeed...
    My chains don't rotate on init. When I drag them, the HingeJoint works.

    Here is a video of the problem :



    This is the GameObjects :
    upload_2014-7-21_18-5-12.png

    On connection_platform :
    upload_2014-7-21_18-6-4.png

    On chains :
    upload_2014-7-21_18-6-58.png
    chain1 -> connection_platform
    chain2 -> chain1
    chain3 -> chain3

    On 16 tonne weight :
    upload_2014-7-21_18-8-4.png

    Thanks.
     

    Attached Files:

  2. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    Hrm. Strange. Reminds me of something I saw when I was experimenting with negative scales. Do you have any of those in there?
     
  3. Themandunord

    Themandunord

    Joined:
    Jul 7, 2014
    Posts:
    11
    I don't have negative scales :/
     
  4. Themandunord

    Themandunord

    Joined:
    Jul 7, 2014
    Posts:
    11
  5. Themandunord

    Themandunord

    Joined:
    Jul 7, 2014
    Posts:
    11
    I resolve my problem with a small fix...
    I check isKinematic for every rigidbody2D.
    And I add a script :
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ChainPhysic : MonoBehaviour {
    5.  
    6.     // Use this for initialization
    7.     void Start () {
    8.         rigidbody2D.isKinematic = false;
    9.     }
    10. }
    And when I launch the game, it works... I don't understant why !
    If "isKinematic" don't take the value of true, physics don't work...

    If someone know why ?

    Thanks.