Flipping Sprite incorrectly?

Recording #161

When the “onTriggerExit2D” is triggered & the collider is not touching the surface, the entire sprite flips & the face of the dino is located where the box collider is. What I am ideally looking for is for the flipping of the animation around the box collider, as opposed to flipping the entire sprite. That way, the feet would still be above the ground, as opposed to only the dino’s face is above the ground.
Thoughts?
Steve

The simple solutions are always the best. Edit the sprite.

I don’t think I am understanding the answer, or perhaps I am explaining the question incorrectly.

As my enemy approaches the ledge…
2022-01-02_08-47-41

He flips entirely & now his feet are hanging in the air…
2022-01-02_08-48-22

How can I edit the sprite to fix this?
Cheers!
Steve

See your bounding box? It’s way too big. Start with that. What I mean is, you see all that leading dead space in your sprite (and a bit on the bottom/top too), jump into the sprite editor and trim that out.

That being said, I thought about it more and you could always change the pivot point (center) of your sprite to the center of the dinosaur. That way it’ll pivot more of where you’d expect.

Either way, you may need to adjust your colliders.

Adjusting the pivot point solved everything! I placed it between it’s feet and now it is flawless Thanks so much!

Steve

P.S. You’re correct - it messed up all of my colliders, so I had to delete & re-add them

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms