![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | 81Vm3 |
script:
if get_slide_count() != 0 :
var enemy = get_slide_collision(get_slide_count()-1)
if enemy.collider.is_in_group("enemies"):
if enemy.normal == Vector2(0, -1):
enemy_as_floor = true
print("yes: ", enemy.normal)
else: print("not: ", enemy.normal)
output when player on the top of a enemy:
yes: (0, -1)
not: (0, -1)
yes: (0, -1)
not: (0, -1)
yes: (0, -1)
not: (0, -1)
yes: (0, -1)
not: (0, -1)
yes: (0, -1)
not: (0, -1)
sometime it also give out:
not: (0, -1)
yes: (0, -1)
not: (0, -1)
not: (0, -1)
not: (0, -1)
not: (0, -1)
not: (0, -1)
yes: (0, -1)
yes: (0, -1)
yes: (0, -1)
yes: (0, -1)
as you see, the enemy.normal is (0, -1) on every outputs, but enemy.normal == Vector2(0, -1) return false? where I do wrong? can anyone explain it