Beginner
Beginner

Reputation: 67

interact only with some physics bodies and ignore others

I have a player and I want to change its behavior regarding physics after it collects a PowerUp. When he collects the powerUp I still want him to be able to interact with the physics bodies of the coins, so he can still collect them. But I want him to ignore the physics Body of the Walls so he can fly through them.

I don't really want to set the physics body from the walls to nil because when the power Up runs off, I have to reattach the physics body to the walls again.

I guess there is some variable for the physics body I cant find right now.

Appreciate any help

Upvotes: 0

Views: 52

Answers (1)

Beginner
Beginner

Reputation: 67

Okay this question was pretty simple, you just have to set the collisionBitMask and the contactTestBitMask correctly

Upvotes: 1

Related Questions