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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Players stutters when attached to fixed joint

Discussion in 'Physics' started by mrCharli3, Jul 26, 2018.

  1. mrCharli3

    mrCharli3

    Joined:
    Mar 22, 2017
    Posts:
    956
    I have a rock that slides down a hill, this is controlled using an animation (I used to do it using physics and low friction materials, but got some unwanted behaviour 5% of the time).
    In order for my player to stay attached to the rock during the slide, I am using a fixed joint in the middle of the rock (The joint is a child of the rock, the rock has no RB).
    While the player stays attached, it stutters a lot and also drags a bit behind, looks very un-natural. The rock does move quite fast.
    Unfortunately adding the player as a child-object of the rock is not an option.

    player RB:


    Joint:


    Does anyone have any ideas what could be causing it?
     
    Last edited: Jul 26, 2018
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,423
    As the rock has no RB then the fixed joint attaches the player to the world. You may add a kinematic Rigidbody to the rock and attach the joint to it (Connected Body). Then animate the rock and translate the pose to the rb via Rigidbody.MovePosition and Rigidbody.MoveRotation (from FixedUpdate).
     
  3. mrCharli3

    mrCharli3

    Joined:
    Mar 22, 2017
    Posts:
    956
    Thanks, think simply setting Update mode to "Update Physics" instead of Normal seems to have solved it :)

    ?
     
    Last edited: Jul 27, 2018