Skip to content

Changes to Actor.anchor are only applied to the graphics component #3177

Discussion options

You must be logged in to vote

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 the PolygonCollider.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Autsider666
Comment options

@eonarheim
Comment options

@eonarheim
Comment options

@VaughanRSanders
Comment options

Answer selected by VaughanRSanders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants