Hi there, I'm fairly new to Godot Mono but have been coding in Unity for a while now. I finished the tutorial on the docs for your first game, but have been stuck ever since afterwards.
I'm trying to access a variable from an instanced 'PackedScene' object, but the editor will simply not budge.
The main scene:
public class Main : Node
public PackedScene Scene;
public override void _Ready()
Node image = Scene.Instance();
The image scene:
public class Scene: Area2D
public Sprite GetSprite => GetNode<Sprite>("Sprite");
public int Width
get => GetSprite.Texture.GetWidth();
public int Height
get => GetSprite.Texture.GetHeight();
The code is simplified for this question, but gives me this error;
Main.cs(23,18): error CS1061: 'Node' does not contain a definition for 'Width' and no accessible extension method 'Width' accepting a first argument of type 'Node' could be found (are you missing a using directive or an assembly reference?)
If I manually Instance the scene via the UI and use the following code, it does get the correct value; but that's not what I'm after since I want to use dynamic instancing.
Thanks in advance.