Reputation: 109
Im using Godot Engine, i have encountered a problem. I want to acess a node outside of my parent i assigned the script to.
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?
Upvotes: 0
Views: 4060
Reputation: 26
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
Upvotes: 0