![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Lodea |
I’m sorry if the question seems super trivial and obvious, but I’m new to Godot and I searched through the forum and the web and couldn’t find an answer to the problem.
I created an instance of a scene (with a ColorRect as its head node) in another Scene’s script. It works well so far, but I couldn’t find how to change its parameters, specifically its position.
I tried the following code but it returned “Invalid get index ‘position’ (on base: ‘ColorRect’).”
extends ColorRect
export (PackedScene) var PriceTag
func _ready():
var pricetag = PriceTag.instance()
pricetag.position.x = 50
owner.move_and_slide()
add_child(pricetag)
It’s pretty difficult to infer the expected syntax without proper code completion.
I’d love if someone could show me how to change a scene’s parameters through code.
Thanks in advance.