Topic was automatically imported from the old Question2Answer platform.
Asked By
verbaloid
I’m using a shader and I need to add OpenSimplexNoise, but the script gives me error one Line 2, on noise.seed = randi():
‘Unexpected token: Identifier:noise’
Just to flesh out the previous answer. I’m guessing you, like me, have a python background where this sort of thing is valid. In gdscript, think of the script you’re writing as being within a class.
Outside a method, all you can do is declare member variables which have a wide scope. Everything else goes within methods. The convention is to put tool, then extends, then member variables, then methods. In this case, it could look something like this: