Making an object not affected by collisions


  • Posts: 19
Hi, I am making a game which contains a ball that has to jump over some squares that come across the screen. If they touch there is a collision and the ball will roll off the screen and the player will lose. I want to make a power up so that the squares go right through the ball like the ball is invisible. Is there any way to turn off collisions between objects like this?


  • *
  • Posts: 4643
You have two ways of doing this easily. The first below is probably the best choice.

1. When the player has a powerup, switch the ball to a different animation (you'll probably want to do this anyway, since the players need visual feedback that they're "invincible"). For that animation, give it a collision shape whose group is one that does not collide with the squares.

2. When the player has a powerup, switch the squares to an animation that does not have a collision shape that collides with the ball (or just an animation without a collision shape altogether).
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.