This is what I have so far:
function getAllColliding(body: Sup.ArcadePhysics2D.Body): Sup.ArcadePhysics2D.Body[] { return Sup.ArcadePhysics2D.getAllBodies() .filter((x)=>Sup.ArcadePhysics2D.collides(body, x)); } let warp = getAllColliding(this.actor.arcadeBody2D) .map((x)=>_.tap(x, (x)=>console.info('a ' + x.actor.getName()))) // :( .map(function(x) { return x.actor.getBehavior(WarpBehavior); }) .filter(_.negate(_.isNil)) .map((x)=>_.tap(x, (x)=>console.info('b ' + x.actor.getName()))) [0]; if (warp) { warp.follow(this.actor); }
No matter what I try, I have a body that just doesn't show up. It doesn't even reach the line I marked with :(, even though I'm certain they are actually colliding. And yet nonetheless, the body in question is still solid!
Things I've tried:
- using intersects() instead of collides()
- swapping the positions of body and x in getAllColliding()
- doing both of the above things at once
- deleting and recreating the actor this behavior is on
- deleting and recreating the actor I'm trying to collide with
- setting the body-to-collide-with to 1x1 at 0 offset with 0 bounce
- confirming, via similar log calls, that the body-to-collide-with is being returned from getAllBodies() (it is)
- setting the body this behavior is on to 1x1 at 0 offset with 0 bounce
- setting the body-to-collide-with as non-movable
- setting the body-to-collide-with as movable
- moving the actor-to-collide-with down the actor list, below an actor that I can work with just fine
- moving the actor-to-collide-with off of its parent
And I'm kinda stuck.