- Home /
Algorithm to script
So i got this algorithm :
Array NoteCount = 5 Int NotesYouHave = 0
If Mouse.LeftClickPressed do: Sphere.Z = this + 5 If Sphere.Collider touch Paper.Collider do: PickupPaper(Paper.Id) end if Wait 1 Second Sphere.Z = this - 5 end if
PickupPaper function do: NotesYouHave = this + 1 if NotesYouHave = NoteCount do: GameFinished() end if end if
but for my game i need a script , can someone create a script from this algorithm or explain to me how to do that ?
you are already wrote the algorithm. just needed some syntax corrections. so, to do that, you need some basic knowledge of scripting in any language supported in unity. also, you will need some scene adjustments, like colliders and triggers settings and links to make script connected to gameplay.
Your answer
![](https://koobas.hobune.stream/wayback/20220613080144im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Vehicle Script Debugging 1 Answer
Need a bit of help with my script (about 100 lines) 1 Answer
How to make the trigger work only once. (SOUND) 1 Answer
Score System help 1 Answer