Figured it out. If you run code that isnt in a class or a function, you have to put all the objects you are referencing above(in the hierarchy) the script you are writing in