Fixed crawling enemy

This commit is contained in:
Felipe M 2021-05-18 20:17:08 +02:00
parent f6758e1dba
commit b7b4d03fda
Signed by: fmartingr
GPG key ID: 716BC147715E716F
4 changed files with 17 additions and 12 deletions

View file

@ -19,7 +19,7 @@ func _physics_process(delta):
floorCast.rotation_degrees = -MAX_SPEED * 10 * WALKING_DIRECTION * delta
if floorCast.is_colliding():
global_position = floorCast.get_collision_point()
var normal = wallCast.get_collision_normal()
var normal = floorCast.get_collision_normal()
rotation = normal.rotated(deg2rad(90)).angle()
else:
rotation_degrees += 20 * WALKING_DIRECTION