0

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?

Community
  • 1
  • 1
Erik77
  • 109
  • 4
  • 12

1 Answers1

0
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