Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Curious behavior with a configurable joint

Discussion in 'iOS and tvOS' started by Timbecile76, Jul 30, 2009.

  1. Timbecile76

    Timbecile76

    Joined:
    Jul 8, 2009
    Posts:
    248
    So in my game, I use a configurable joint on some of the ships to restrict their movement and rotation. The only time they rotate is to face the player.

    basically, I restrict their movement to X Y, and restrict their rotation to Z.

    Works fine in the editor. When I build and run it remotely, the movement restrictions work fine, but the rotation restrictions are all jacked up. The ships rotate in the Z and the Y sometimes, and when they do, the framerate stutters....sometimes bad enough to cause you to lose the game.

    Anyone have a similar problem or any suggestions?
     
  2. Timbecile76

    Timbecile76

    Joined:
    Jul 8, 2009
    Posts:
    248
    bump....

    anyone have any ideas? is there a way to restrict slerp rotation through the code?
     
  3. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Did you ever get to the bottom of this I have a similar problem and I am wondering if this is a bug in Unity iPhone 1.5.

    I have a ball with a rigidbody attached which I am dropping onto a wooden object created in a 3D package with both Mesh Colliders and a Kinematic rigidbody attached.

    The Ball has a configurable joint that is set to the following:
    XMotion: Free
    YMotion: Free
    ZMotion: Locked
    Angular XMotion: Locked
    Angular YMotion: Locked
    Angular ZMotion: Free

    I want the ball to be able to roll on the object on a 2d plane but not forwards and back.

    The problem I have is the ball is dropping off my object because it is moving around in Z. I can see in the Editor that the Z position is constantly fluctuating.

    I have no scripts attached to this ball making it move so this is all happening under the influence of physics.

    Is this a bug?
     
  4. Timbecile76

    Timbecile76

    Joined:
    Jul 8, 2009
    Posts:
    248
    There's only two things I noticed about this issue:

    1. It only seems to appear on the actual iPhone
    2. It only happens when the framerate gets low

    other than that, I never seemed to solve it.
     
  5. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    I get the problem on the desktop too.

    The ball doesn't look like it is moving in Z from the view, but the Z position in the editor is constantly fluctuating up and down too tiny amounts.

    If I rotate the mesh around the ball is resting on, eventually it will fall off.

    Thanks
     
  6. ReJ

    ReJ

    Unity Technologies

    Joined:
    Nov 1, 2008
    Posts:
    378
    Do you have "Configured in World space" set on Configurable Joint
     
  7. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Yes, that is set to on. Here is a screenshot of all the settings:



    Thanks
     
  8. ReJ

    ReJ

    Unity Technologies

    Joined:
    Nov 1, 2008
    Posts:
    378
    Anchor : {x =0, y= 0.5, z = 0}

    If your object is a sphere, are you sure it is a correct place for an anchor? Shouldn't it be in the {0,0,0} instead?
     
  9. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Should it not be 0.5, 0.5, 0.5 which would place the origin dead center?

    I just tried 0, 0, 0 and 0.5, 0.5, 0.5 and it is the same... the Z fluctuates all over the place as soon as it touches my Mesh collider.

    I am right in thinking this joint should mean Z position would stay at 0 all the time?

    Thanks
     
  10. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    OK

    Just as a test I created a brand new Project with just a ball and a cube. Added a rigidbody to the sphere and a configurable joint then placed it above a cube that is titled at an angle.

    When I run this scene in the Editor on Unity iPhone 1.5 with the ball selected, the Z position changes.

    I have attached the scene so you can see this behavior for yourself.

    I used configurable joints in the past without issue, so either its now broken in 1.5 or (more likely) I am doing something stupid.

    Thanks
     

    Attached Files:

  11. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Tried loading the same package into Unity Full (desktop) and it does the same.

    Am I going mad here? I thought setting ZMotion to Locked will prevent movement in Z.

    Thanks
     
  12. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Can anyone confirm they see the same problem with the test file supplied?

    Thanks
     
  13. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
  14. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    The Z coordinate of the object does seem to change but only by a very small amount. I'm not sure if this is a bug as such or just a limitation of mathematical accuracy in the joint or the collision.
     
  15. Beliar

    Beliar

    Joined:
    Nov 26, 2010
    Posts:
    46
    Thank you very much man! That solved my issue :)... this should be on by default imho.
     
  16. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    107
    11 years later and the configurable joint still doesn't make any sense. Probably why you can't find a single unity tutorial on how to configure it. On my 12th hour and getting nowhere. Awesome.