Changes to Actor.anchor are only applied to the graphics component #3177
Answered
by
Autsider666
VaughanRSanders
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
Autsider666
Aug 29, 2024
Replies: 1 comment 4 replies
-
The easiest way to apply a new anchor to the collider of an actor outside of the constructor seems to be to create a new one using You're running into this issue because the collider doesn't have any knowledge of the anchor of its entity. |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
VaughanRSanders
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The easiest way to apply a new anchor to the collider of an actor outside of the constructor seems to be to create a new one using
actor.collider.set(Shape.Box(width, height, newAnchor))
.You're running into this issue because the collider doesn't have any knowledge of the anchor of its entity.
It looks like the collider gets the anchor in the actor constructor, but the
Box
function only uses it to create the initial points of thePolygonCollider
.