#How do I make my projectiles spawn on the correct side?

5 messages · Page 1 of 1 (latest)

white charm
#

I'm trying to add projectiles to my game, but for some reason when I face left the bullets will spawn behind the player. They still go that direction though. This is because the Node2D from which it spawns doesn't flip over to the other side for some reason. How do I fix this?

dapper scroll
# white charm I'm trying to add projectiles to my game, but for some reason when I face left t...

the position of a node isn't affected by its own scale or rotation, only by the transform of its parent (and therefore that ones parent and so on). So you would have to flip the scale of the character body itself, or just flip the x-position of the Node2D.
But i'll just warn you that non uniform scaling (or maybe even scaling at all) isn't very compatible with physics. so i would advise against flipping the scale of the whole character, and also advise agains flipping the scale of your hitbox.

white charm
#

What should I do then?

dapper scroll