Search Unity

Question Unexpected character behaviour

Discussion in 'Physics' started by martincz26, Jan 26, 2023.

  1. martincz26


    Jan 28, 2021
    Hi, I'm relatively new to Unity and as part of my learning process I decided to create a ragdol simulator.

    So I created a character controller which I use to control my character from a third person perspective, using Cinemachine my character can run and jump. Everything works perfectly. So it's time to apply ragdol to my character and move forward in development. After applying ragdol, however, I ran into two problems.

    1) Spontaneous movement of the character.

    Which I believe is due to gravity acting on the individual ragdol colliders, while the character itself is wrapped by its own collider, which I use to calculate if the character is on a swing using raycast. So my question is whether I can somehow bulk disable gravity for the ragdol until it is needed.

    2) Character explosion when ragdol is turned on.

    As soon as I activate ragdol by turning off the animator, the unwanted effect of the character being thrown by some force occurs. Is there any way to find out what the force is? The only force I apply in the code is the force on vector3, upwards. When he jumps. It seems to be caused by individual ragdoll colider joints. But moving them apart or overlapping them doesn't change anything.