I have created a spacial node called Troll, which has two children: Troll and Sight. Both of them are areas. This is my code for the spacial Troll:
var velocity = Vector3(0, 0, 0)
var saw = false
var player = null
const SPEED = 2
if saw == true:
look_at_from_position(player.position, player, Vector3(0, 1, 0))
velocity.y += SPEED
player = body
saw = true
player = null
saw = false
This is the error:
Invalid type in function 'lookatfrom_position; in base "Spatial (MainTroll.gd)'. Cannot convert argument 2 from Objects to Vector3.
"MainTroll.gd" is the script (shown above)
Do you know what's wrong? Sorry, I'm new to this function.