Godot Version
4.2.1 (Steam)
Question
I have already created and programmed an enemy for the 3D game I am making, and I am trying to create a spawner for it, so every 5 seconds the spawner creates an enemy. So I have a marker3d node where I want the enemy to spawn relative to where the spawner is, but for some reason when I place the spawner in a level I get an error in the debug console: E 0:00:00:0575 enemy.gd:68 @ pathfind(): Node origin and target are in the same position, look_at() failed.
<C++ Error> Condition “p_pos.is_equal_approx(p_target)” is true.
<C++ Source> scene/3d/node_3d.cpp:933 @ look_at_from_position()
enemy.gd:68 @ pathfind()
enemy.gd:50 @ _physics_process().
The robot does spawn, but for some reason it spawns in a set location far up and to the left of where my marker3d node is.
I am using GDScript, here is the code that instances an enemy scene:
func _on_spawntimer_timeout():
const ENEMYSP = preload(“res://scenes/objects/enemy.tscn”)
var robot_inst = ENEMYSP.instantiate()
robot_inst.global_position = global_position
add_child(robot_inst)
I have also tried placing a camera3d in the spawner scene and running the spawner scene with F6, and doing this will cause the spawner to work as expected. It only seems to bug when instanced.
Please, any help would be appreciated. I am new to Godot, so sorry if this is dumb or obvious.