Skip to content

Collision not detected when object is not moving #11

@ramonfr2016

Description

@ramonfr2016

I have 2 rigidbodies in my world: a ball (with a sphere shaped rigidbod), and a player (with a cylinder shaped rigidbody).

The player follows the mouse pointer and sets the location of its rigidbody (I know that setting the rigidbody position this way isn't a good practice).

The player's rigidbody is static.

When the player touches the ball, it's able to move it. But when the ball is not moving (0 velocity), the player doesn't affect the ball, it penetrates it.

I tried setting the isStatic property of the player's rigidbody to false, the same thing happened.

What's going on and how can I solve it?

//player's body
playerBody = new RigidBody(cylinder);
playerBody.IsStatic = true;
//ball's body
 ball = new RigidBody(sphere);

Also, to make the ball slow down and simulate friction with the ground, I'm using the following line:

ball.AngularVelocity *= 0.5f;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions