Godot 2.1.4 stuck on a node in script

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By toyson

Hello, i am having a problem with godot 2.1.4, i usually call lots of node into the script but i noticed that after a while, it gets stock on a node, if i try using another node it keeps on giving me the same property of the previous node, but the problem affects only that scene.

extends Node2D
const PLAYER_SCENE = preload("res://Scene/Player.tscn")
var player_scene_instance
onready var player_spawner = get_node("Player_nodes/Player_spawner")
onready var player_camera = get_node("Player_nodes/Player_camera")

const GROUND_SCENE = preload("res://Scene/Ground.tscn")
var ground_scene_instance
onready var ground_spawner = get_node("Game/Ground/Ground_nodes/Ground_spawner")
onready var ground_container = get_node("Game/Ground/Ground_nodes/Ground_spawn_timer")
var ground_spawner_speed = 500
var ground_velocity = Vector2(ground_spawner_speed,0)

const COIN_SCENE = preload("res://Scene/Coin.tscn")
var coin_scene_instance
onready var coin_spawner = get_node("Game/Coins/Coin_spawner")
onready var coin_container = get_node("Game/Coins/Coin_container")
var coin_spawner_speed = 20
var coin_current = 0
var coin_total = 0

var score_current = 0
var score_best = 0
func _ready():

func _process(delta):
	**ground_spawner.translate(ground_velocity * delta)** --(this is the error given{{Attempt to call function 'translate' in base 'null instance' on a null instance.}})
	coin_total += coin_current
	if score_current > score_best :
		score_best = score_current

func PLAYER():
	player_scene_instance = PLAYER_SCENE.instance()

func _on_player_timer_timeout():

func GROUND():
	ground_scene_instance = GROUND_SCENE.instance()

func _on_Ground_spawn_timer_timeout():

func COIN():

This is the picture of the nodes i used

:bust_in_silhouette: Reply From: happycamper

If you are getting null instance, then when you set groundspawner it was unable to find the node. start looking at this line here->

onready var ground_spawner = get_node( "Game/Ground/Ground_nodes/Ground_spawner")

check to make sure your spelling is correct, case sensitive. I assume you manualy put Groundspawner node in the tree from the editor rather than adding it using gd script.