0 votes

Hello, This is my first question and I'm new to godot. For testing I'm creating small platforms and I used sprite's $Sprite.flip_h for flipping the player. Now i want to implement player attack so i created a collider on players front side. Now the problem is flipping the player by sprite, Hotbox does not flip itself.
If i make hotbox as a child of Sprite it maybe flip with sprite node. but I don't move hotbox into the Sprite node.
Here i attached some screenshots of my project hierarchy, Please let me know if you know a better solution.

enter image description here
enter image description here

asked Feb 24 in Engine by juju (18 points)

1 Answer

0 votes
Best answer

Just invert the scale-property of your Player-node.

The default is (1, 1). If you set it to (-1, 1) you will flip it horizontally. If you set it to (1, -1) you will flip it vertically. Note that this is different from flipping a sprite, where just the texture is flipped, not the node itself! So no, even if the Hitbox-node would be a child of your Sprite-node, setting the flip_h-property wouldn't flip the hitbox.

Btw: A "Hotbox" is something very different. ;) Sorry, could not resist.

answered Feb 24 by njamster (9,950 points)
selected Mar 1 by juju

Thanks for the answer! Hot box is my own very unique component ;)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.