hi , i'm making an demonic eye ai from terraria, now im making bound mechanic(when eye touch object it change his direction) and i cant change velocity, when i try vel *=-1 or vel.x +=10000 it do nothing
code:
func _physics_process(delta):
var v = player.global_position - global_position
var angle = v.angle()
if $RayCast2D.is_colliding():
vel *= -1
var r = global_rotation
if presled == true:
global_rotation = lerp(r,angle,.1)
vel = global_position.direction_to($looking.global_position) * speed
vel = move_and_slide(vel)