I have no idea on how to go about this. I know very little about Unity. I have watched a few tutorials but I still don’t understand the coding part of it. I am making a endless runner/platformer where the player gets maths questions on the top of the screen, and they have 4 options to pick from and they have to tap the correct answer in time to make the character jump over obstacles. The questions need to be simple for like 6 to 10 year olds. They come one after another when you get it right and they are generated randomly and don’t repeat. I am sorry but I really can’t figure it out. I have the core game, the character running endlessly and platforms spawning randomly, and the jump button working. I just need the maths part to replace the jump button. And I don’t know how to do the maths part and cannot find and video tutorials. Script is in C#.
What… It takes at least a few months to figure our coding with C#. I suppose that someone could help you out but that is not the point. Why not buy some books on C# and read that up? It make take a few months or years, but heck, if you learn it all, there is nothing you can’t make yourself.
Break it into steps,
- Get empty gui boxes drawing( an array of size 4…where index 0 is the first box)
- When any empty box is clicked, make the player jump
- Generate only addition questions, by creating a script which uses Random.range to generate 2 numbers and also updates a string in your question gui box.
- In the same script, store the answer plus 3 more randomly generated numbers which are not the answer.
- Update each answer gui box by adding the generated number to an index in the array as a string
- Only jump when the player taps a box with the correct answer. (if(Convert.ToInt32(answerBoxArray[0]) == theAnswer))