Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Let's assume this your sprite size is (a, b) and you flip it with your method, it will be (-b, b) and when you flip it again it will still be (-b, b)
You should do it like this
2. your signal connection seem broken, try reconnect it.
3. $Sprite is same as get_node("Sprite"), it is search for direct child node with name "Sprite" of this node. I don't know how you store your Area2d node and Sprite node, you might want try to access parent first
- Enemy (Node2d)
-- Sprite
-- Area2d
--- CollisionShape2d
)
4. global_position return position of Node2d
Note; I am not insult you or something, but I think you should learn more about basic Godot, basic programming (non Godot) and basic game dev. Prefer you to learn from videos not text for now and do along the videos. Good luck
You're doing:
So your width becomes your negative height.
Assuming default values, you went from (1.0, 1.0, 1.0) to (-1.0, 1.0, 1.0)... so the first time, it would seem like it worked.
But then when you run that code again and nothing happens. Because scale.y was never changed, so the negative of it is still -1.0, so scale.x will still become -1.0, not 1.0 like you'd want to.
You just need to do:
Can't connect signal because method is now not found and can't find node in question.
About 4, since you said thing about no existence of coor or coordinate, so I point out proper name of that method.