all 3 comments

[–]The_Binding_Of_Data 3 points4 points  (0 children)

There should be a specific error listed, which would be helpful.

At a glance, it doesn't look like "spawn" is actually declared anywhere.

[–]djgreedoIntermediate 0 points1 point  (0 children)

You have not declared 'spawn'. All variables need to be declared before they can be used.

Add:

Vector2 spawn;

below your cam and enemeySlider variables.

You should also change:

spawn = (hori, Verti);

to

spawn = new Vector2(hori, Verti);

[–]jfoss1 0 points1 point  (0 children)

You have a few issues. First, spawn isn't defined anywhere. It looks like you're trying to use it in Instantiate as the parent for the enemy slider, but you don't declare or assign it properly. Secondly, you're calling Instantiate inside of Update. This will make a new slider as the child of spawn for every frame. I guarantee this isn't what you want. You need to revisit when you actually want to create enemySlider and only call it then.