diff --git a/lib/game/components/crossing_ramp.dart b/lib/game/components/crossing_ramp.dart index 8d9acd3a..a039d58e 100644 --- a/lib/game/components/crossing_ramp.dart +++ b/lib/game/components/crossing_ramp.dart @@ -77,17 +77,16 @@ abstract class RampArea extends BodyComponent { @override Body createBody() { - final fixtureDef = FixtureDef(shape)..isSensor = true; + final fixtureDef = FixtureDef(shape) + ..isSensor = true + ..filter.categoryBits = _categoryBits; final bodyDef = BodyDef() ..userData = this ..position = _position ..type = BodyType.static; - final body = world.createBody(bodyDef); - body.createFixture(fixtureDef).filterData.categoryBits = _categoryBits; - - return body; + return world.createBody(bodyDef)..createFixture(fixtureDef); } }