Closed quinton-ashley closed 7 months ago
I think there are two ways to solve this:
resetMass
would not change the sprite's center of mass
resetMass
would change the sprite's center of mass, then keep the sprite in the same location in the world after the collider is added but actually change its position coordinates to reflect the center of mass change.
ChatGPT says this:
"If you want the center of mass and the body's location to be the same, it would be better to reposition the fixtures relative to the new center of mass while maintaining the same position in the world. This is because changing the center of mass directly can lead to unexpected physics behavior, as it changes the distribution of mass in the body."
Which I agree with, I will try implementing this now.
Okay problem with that is when adding multiple colliders to a sprite you'd have to take into account its center changing, not backwards compatible or fun!
fixed in v3.20.1, see release changelog
I could've sworn I already fixed this problem lol but yeah... my intention was always to have a sprite's position and the sprite's center of rotation remain the same. Maybe this changed in planck v1 and I didn't notice? idk