How to give a instantiated scene a position

Godot Version

4.5

Question

What I’m currently trying to do is have a shop menu when it purchases a unit it then gets instantiated in the main scene. However I would like it when the unit is instantiated it gets instantiated in a specific area but I can’t figure it out exactly.

code

if you need more details please let me know!

instantiate() returns a node reference, not name. You can use it directly to set the position:

var new_unit = requested_unit.instantiate()
add_child(new_unit)
new_unit.position = ...

I see what I’ve done wrong now, the script is instantiate the scene, the scene itself just a node which doesn’t have a position property. Thank you!