How to access from filesystem to scene please help

Godot Version

4.3

Question

Is this correct, i want to access the animation player in my monster.tscn in my filesystem to my monster_run.tscn scene, like the monster.tscn contains the actual monster with the animation, and my monster_run.tscn contains my characterbody3d, the script, and basically what you needed for a monster kind of thing. I am a newbie so i still don’t have an idea how to do it

var m_holder = preload(“res://Walls/scenes/monster.tscn”)
var monster_anim
var monster

func ready():
monster = m_holder.instantiate()
monster_anim = monster.get_node(“AnimationPlayer”)

The name of the function is _ready()
Other than that I don’t see an issue why it shouldn’t work. Do you get an error when running the project? Or what’s the issue you have?

oh yeah i forgot to put the _ here, but it said null so i dont get why

You get null on what? Please paste an error message.

there was an error but it wont display it. in my filter stack variables, my monster and monster_anim is < null >, but there was now a reference to my tscn