system
February 4, 2021, 4:08pm
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
SatinOregano503
showcase video:
Godot_problem - Album on Imgur
My problem is, I think simple. If the enemy facing left it detects player but if facing right it’s not. What’s the case?
Hitbox/CollishionShape is the area of the enemy, when area entered by player play animation attack.
if direction == 1:
$Sprite.flip_h = false
$Sprite/Sprite2.flip_h = false
$Sprite/Sprite2.position.x = 50
$HitBox/CollisionShape2D.position.x = 376
else:
$Sprite.flip_h = true
$Sprite/Sprite2.flip_h = true
$Sprite/Sprite2.position.x = -50
$HitBox/CollisionShape2D.position.x = 156
system
February 4, 2021, 5:41pm
2
Reply From:
afk27111
Hmm… I’m a beginner, but I found out about this good website that can tell you more about areas, I mean that website worked for me.
Link - https://kidscancode.org/godot_recipes/g101/3d/101_3d_04/
Thanks for comment, i will look at this too.
SatinOregano503 | 2021-02-04 18:01
system
February 4, 2021, 6:00pm
3
Reply From:
SatinOregano503
Hi! I already found a solution. Hitbox/CollishionShape was detecting Player’s body but animation was blocking itself on the right side. I added a variable named blocked_anim and set it to false. I play animation only when its false, it worked. Animation is playing on the right side and left. Sometimes random idea’s are the best!