In your code you are casting the sprite node to a Node class, which is the base class, so you will only be able to access the base classes functions and properties. What instead you need to do is define the variable as public Sprite sprite on line 1 and then in line 4 use something like sprite = GetNode<Sprite>(“Sprite”) and then it should work.
Also, while the naming shouldn’t matter in this case since C# it’s capitalized (Sprite rather than sprite), I agree with @fire7side in that it’s probably a good idea to, if possible, name the variable something that doesn’t have the exact same name as the node, if nothing else than it will be easier to refactor later if you need to adjust the code :smile:
Edit: My bad, I just read it again and realized you are not trying to access a Sprite node like a Godot one, but rather a custom one. :sweat_smile:
Thankfully it’s pretty much the same to fix it though, you just need to replace Sprite with the name of the class with the custom function. For example, if your class is called something like SpatialSprite In the .cs source file, then you want to use public SpatialSprite sprite on line 1 and sprite = GetNode<SpatialSprite>(“Sprite”) on line 4.