Custom setCollider?

When students use the setCollider block, they have options of a rectangle or circle. What if their sprite is flat on bottom like a rectangle and has a curvy surface at the top? Is there a way to have a custom shape so it is more realistic when they collide?

1 Like

The only options for setCollider is a rectangle or circle. I found this suggestion in the Game Lab Documentation for setCollider: “Often the image default rectangle collider is not appropriate for collision detection so you can set a smaller circular or rectangular collider and offset from the sprite’s center.” Hopefully messing around with the size and sprite center will help for creating more realistic collisions with different shaped sprites.

Is there a way to change the size of the Collider without changing the sprite?

I know this is old but it appeared to be a common issue. You can use the setCollider property, click setCollider to see documentation. If you expand the tool it can essentially change the width and height of a rectangle to a specific line.

As far as an item with curvature I believe you could create multiple collision points that still move with the sprite.

1 Like