11 - Collider Isolation
From edition=11
onwards,
if you create a collider with an <Id>
, for example PolygonCollider<myShield>
,
the collision events will be sent to both BeforeCollide/AfterCollide
as well as BeforeCollide<myShield>/AfterCollide<myShield>
.
Previously they would only be sent to the latter.
This would cause people to spend a lot of time debugging why they were not getting any collision events
on BeforeCollide
and AfterCollide
.
This breaking change helps Easel match people's expectations better.
Upgrade instructions
First, set edition=11
(or higher) in your easel.toml
file.
In your Editor, search all files for the string PolygonCollider<
(the angle bracket has been left open intentionally).
If you find any matches, you may need to upgrade your code to the new behavior.
Let's say you have a collider like this (parameters omitted for brevity):
PolygonCollider<myShield>(...)
This will now be sending its collision events to BeforeCollide/AfterCollide
as well as BeforeCollide<myShield>/AfterCollide<myShield>
.
- If you don't have any code that listens to
BeforeCollide/AfterCollide
, you do not need to do anything. - If you do have code that listens to
BeforeCollide/AfterCollide
and you don't want to receive the events twice, you should add theisolate=true
parameter to your PolygonCollider call. This will make sure that the collider only sends events toBeforeCollide<myShield>/AfterCollide<myShield>
, like before.
Opt-out
If you would like to temporarily opt-out your entire project from this change, you can set isolateCollidersByDefault=true
in legacy.toml
.
This will preserve the old behavior until you have the time to upgrade your code.
Create a legacy.toml
in the root of your project that looks like this:
[legacy]
isolateCollidersByDefault = true