so Im making a wave shooter game and I got these bugs that I do not know how to fix this it says unexpected indentation and Ive tried every possible solution yes I do know that gd script is similar to python and its indent sensitive don't tell me plz anyway heres the code:
extends Sprite
var speed = 75
var velocity = Vector2()
var stun = false
var hp = 3
var blood = preload("res://blood.tscn")
if hp <= 0:
if Glob.camera != null:
Glob.camera.screen_shake(120, 0.3)
Glob.points += 1
if Glob.node_creation_parent != null:
var blood_part = Glob.instance_node(blood, global_position, Glob.node_creation_parent)
blood_part.rotation = velocity.angle()
queue_free()
print(Glob.points)
func basic_move_towrds(delta):
if Glob.player != null and stun == false:
velocity = global_position.direction_to(Glob.player.global_position)
elif stun:
velocity = lerp(velocity, Vector2(0, 0), 0.3)
global_position += velocity * speed * delta