A couple "worldbounds" event questions

  1. Why firing worldbounds requires both body.onWorldBounds=true and body.setCollideWorldBounds(true), what if I just want to know if object touches the world bounds but don’t want collides it?
  2. Why the body.CollideWorldBounds resets to default after adding object to group and body.onWorldBounds not? How can I predict such behavior? Is there it in documentation?
  1. collideWorldBounds is for whether there’s a collision at all and onWorldBounds is for whether you want an event fired for it. Inside-or-outside isn’t really covered. You could use Rectangle.Contains() or maybe a special overlap collider.
  2. See Arcade.Group#defaults.
1 Like