# How can I get a node from an instanced scene by name?

**URL:** <https://forum.godotengine.org/t/how-can-i-get-a-node-from-an-instanced-scene-by-name/18851>\
**Category:** Archive\
**Created:** [June 24, 2020, 12:47pm UTC](https://forum.godotengine.org/t/how-can-i-get-a-node-from-an-instanced-scene-by-name/18851 "2020-06-24T12:47:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forum.godotengine.org/uploads/default/original/2X/4/4b0a7fa8a6334634b94a13d421f0d99e6f04e21f.svg) [@system](https://forum.godotengine.org/u/system)\
**Post date:** [June 24, 2020, 12:47pm UTC](https://forum.godotengine.org/t/how-can-i-get-a-node-from-an-instanced-scene-by-name/18851/1 "2020-06-24T12:47:32Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Attention** | Topic was automatically imported from the old Question2Answer platform. |
| 👤 | **Asked&nbsp;By** | MaaaxiKing |

My SceneTree:

Game (Node)

> Player (KinematicBody2D) (instanced, script attached) (has an AnimatedSprite as a child with `animation_finished()` connected to the player script)  
> Ball (RigidBody2D) (instanced, script attached)

In the player script I tried:

```auto
func _on_AnimatedSprite_animation_finished():

```

1. `get_tree().get_root().get_node("Ball").my_function()`
2. `get_tree().get_node("Ball").my_function()`
3. `get_parent().get_node("Ball").my_function()`.

How can I call a function on the Ball or change some of its properties?

# **The thing is I don’t know, that when you instance the ball, what is it a child of?? This information is kinda nececarry.**

Czselu349 | 2020-06-24 20:30

I instanced the scene even before the game has started. The Ball is child of Game.

MaaaxiKing | 2020-06-24 20:38

---

<div class="post-metadata">

**Author:** ![system](https://forum.godotengine.org/uploads/default/original/2X/4/4b0a7fa8a6334634b94a13d421f0d99e6f04e21f.svg) [@system](https://forum.godotengine.org/u/system)\
**Post date:** [June 25, 2020, 11:34am UTC](https://forum.godotengine.org/t/how-can-i-get-a-node-from-an-instanced-scene-by-name/18851/2 "2020-06-25T11:34:40Z")

</div>

| | | |
| --- | --- | --- |
| 👤 | **Reply From:** | Czselu349 |

I think, that the 1st option should work just fine.  
I f you want to change a property of another node you can do it like this:

```auto
get_tree().get_root().get_node("name_of_the_node").property = value

```

---

<div class="post-metadata">

**Author:** ![system](https://forum.godotengine.org/uploads/default/original/2X/4/4b0a7fa8a6334634b94a13d421f0d99e6f04e21f.svg) [@system](https://forum.godotengine.org/u/system)\
**Post date:** [June 25, 2020, 1:02pm UTC](https://forum.godotengine.org/t/how-can-i-get-a-node-from-an-instanced-scene-by-name/18851/3 "2020-06-25T13:02:28Z")

</div>

| | | |
| --- | --- | --- |
| 👤 | **Reply From:** | MaaaxiKing |

I just changed to `get_node("/root/Game/Ball").my_function()` and now it works.
