0
votes

Im using Godot Engine, i have encountered a problem. I want to acess a node outside of my parent i assigned the script to. My current nodes

I have assigned my script to player and i need to access ThirdPersonCamera. But i cant move ThirdPersonCamera into player because its an interpolated camera and needs to move freely.

onready var camera1 = get_node("Head/FirstPersonCamera")

This is my first camera which i can acess, because its a child. But how do i access the ThirdPersonCamera?

1
Have you tried get_tree().get_root().get_node("ThirdPersonCamera")? - Christopher Bennett

1 Answers

0
votes
onready var camera2 = get_node("../ThirdPersonCamera")

The .. will select the parent node and from there you can select the child of the parent and in this case the camera node