How to create a hollow collision shape? #1381
-
I'm triyng to create a single Entity with one Hitbox that should process collisions only on the stroke(border) of the shape .
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, could you provide the use case for this and preferably a simple drawing sketch that shows how it is used / how it should work? Thanks. |
Beta Was this translation helpful? Give feedback.
I see, if my understanding is correct, when you use
outer = new HitBox("outer",BoundingShape.circle(radius));
, you end up with a filled rigid circle, but what you actually want is an annulus (a doughnut like shape with a hole inside). FXGL's rigid body dynamics internally uses box2d, which has edge and chain shapes, which may help you, take a look at their documentation.In FXGL, you can call
BoundingShape.XXXX
to get edge / chain shapes, instead of circles. See if it works.