I am having difficulty trying to instance a scene with if statements. I am consistently getting this error no matter what I do.
Here is the code:
#Object Placement Variables
signal place_cube
const scroll_speed = 1.2
var holding_object = false
var showing_menu = false
#var the_object
export (PackedScene) var scene_1
func _ready():
#if holding_object == true:
#pass
#This is for testing purposes
var cube_instance = scene_1.instance()#The error keeps showing up here
#which means that scene_1 is somehow "null"
cube_instance.set_translation(Vector3(0,0,8))
add_child(cube_instance)
pass
FYI: The variable scene_1 is set as a script variable for the node this script is connected to. It is a scene that contains a cube and the path to it is correct, as I have double checked it.