This project is read-only.

Turning an objects collisions on / off

Oct 30, 2012 at 9:44 PM

Hi there,

Forgive me if I'm wrong but I've been trying to make an object loose its collision properties so that objects can briefly pass through it, unfortunately none of the properties I have changed have successfully allowed for this.

I've tried the following,

IsEnabled = false;

CollisionEventDisable = true;

IsHitTestVisible = false;

CausesCollisions = false;

Neither of these seem to allow what I'm after.  Basically I have a static rectangle, and I would like to make it "solid" only at certain times, the rest of the time I'd like it to act as if It's not there.  Is this possible?

Many thanks.

Nick.

Oct 30, 2012 at 10:36 PM
you could use IsSensor for that... spr.BodyObject.IsSensor = true

Oct 30, 2012 04:45:04 PM, physicshelperxaml@discussions.codeplex.com wrote:

From: firkinfedup

Hi there,

Forgive me if I'm wrong but I've been trying to make an object loose its collision properties so that objects can briefly pass through it, unfortunately none of the properties I have changed have successfully allowed for this.

I've tried the following,

IsEnabled = false;

CollisionEventDisable = true;

IsHitTestVisible = false;

CausesCollisions = false;

Neither of these seem to allow what I'm after. Basically I have a static rectangle, and I would like to make it "solid" only at certain times, the rest of the time I'd like it to act as if It's not there. Is this possible?

Many thanks.

Nick.