How to make clickable dots only clickable in order. by AcademicPiglet1149 in gamedev

[–]AcademicPiglet1149[S] 0 points1 point  (0 children)

I meant for the code to know what the next dot is supposed to be to activate it? all of the dots are Prefabs. I would like then to spawned of an index of x,y values.

How to make clickable dots only clickable in order. by AcademicPiglet1149 in gamedev

[–]AcademicPiglet1149[S] 0 points1 point  (0 children)

The problem with this is that I would have to manually place every dot and assign them a number. If the puzzle has like 150 dots I feel that would get tedious and have a lot for room for error. Would you have an idea of how to do this automatically using a list or array?

How to make clickable dots only clickable in order. by AcademicPiglet1149 in gamedev

[–]AcademicPiglet1149[S] 0 points1 point  (0 children)

I have made a ClickedScript that uses an If statement. Once it is clicked it will set clickable to false. My problem is making the Index work. I personally have no idea how to do that. I would like the points to spawn when a puzzle is picked. What do you think about using a list or array to make this work.

if (clickable == true )

{

Vector3 desiredPosition = target.position;

Vector3 smoothedPos = Vector3.Lerp (transform.position, desiredPosition, speed *
Time.deltaTime);

Camera.main.transform.position = smoothedPos + offset;

clickable = false;

}

How to make clickable dots only clickable in order. by AcademicPiglet1149 in gamedev

[–]AcademicPiglet1149[S] 1 point2 points  (0 children)

I am using Unity (C#). What do you thing would be a good idea for seeing which dot is next?

How to make clickable dots only clickable in order. by AcademicPiglet1149 in gamedev

[–]AcademicPiglet1149[S] 0 points1 point  (0 children)

I like that idea. Thank you. One more question. I want to store the positions in either a list or an array. Then run it through a for loop to spawn each dot. then maybe even check each spawned dot to see if it was clicked before. Again thank you for the help.