Collision not giving velocity to object

Hello!

I am using camera input to track my head, and move a gameobject looking like a head in a unity chene. The head is supposed to push others rigidbody objects in the scene.

The problem is the head only pushes the object without giving it any velocity. It’s almost like the drag is super high.

The position of the head is set like this:

var head = body.Joints[0];

joints[0].transform.position = new Vector3(head.WorldPosition.X / head.WorldPosition.Z * scaleUpFactor,
head.WorldPosition.Y / head.WorldPosition.Z * scaleUpFactor,
24f);

Both head and other objects have colliders and rigidbodies.

Thanks for any help :slight_smile:

Have you tried using RigidBody.MovePosition instead of transform.position?

Ye, good suggestion. I tried changing transform.position to GetComponent.MovePosition and .Position, but then then the position of the gameobject doesn’t move for some reason.

Do the joints collide with each other? Then Rigidbody might stop the movement because of this.

The joints did collide with eachother, we fixed it by putting the body joints and other objects on two different layers. Thanks again PGJ!.

We didn’t find any way to give objects velocity on collision, so we put a bounce script on each joint looking like this:

public class BounceOnCollision : MonoBehaviour
{
[SerializeField]
private int bounceForce = 1;
private void OnCollisionEnter(Collision collision)
{
Vector3 otherPos = collision.collider.transform.position;
Vector3 thisPos = this.transform.position;
Vector3 collisionDirectionUnitVector = (otherPos - thisPos).normalized;
collision.collider.transform.GetComponent().AddForce(collisionDirectionUnitVector * bounceForce);
}
}

It looks pretty natural, so i think problem is solved :slight_smile: