- Home /
Allowing users to make graphs in game--is this possible?
I'm currently building an educational app, and I'm a complete beginner at Unity so I just wanted to know if what I want to do is possible, and if so, where to even begin.
I want to allow users to graph their own data in unity--as in, they input a number, and that point is created and displayed on a graph. They would only need to do this for about 3 points.
Thanks!
Answer by AaronBacon · Feb 19, 2019 at 01:03 AM
Short answer: Yes.
Longer Answer:
Well, I'll first say it's definitely possible in Unity, but as for how, it really depends on how you want to go about rendering it. One thing you'll definitely need is Mathf.
https://docs.unity3d.com/ScriptReference/Mathf.html
Mathf is used for all sorts of mathematical calculations in Unity, and due to the nature of your app, it sounds like you'll be needing quite a bit of it.
So Mathf can probably generate whatever data you need, but depending on how you want to render it depends on the specific code you'll need. Remember, Unity has a huge community, and almost everything you want to do has probably been tried in some form by someone else, and if they ran into issues, there's probably an answer for it somewhere. The trick is to break down problems, for example, instead of directly searching for making a graph (in terms of googling, asking specific questions on here is obviously fine), you can instead break that down into "creating graphics in unity" and "getting world coordinates in unity" and then combine those 2 questions to create a script that can render a set of points at a specific set of coordinates generated by the Mathf Function above.
So hopefully something from that helps, if not, just watch the Youtube video, that should help =P
Thank you! This is not quite what I meant, but it gives me an idea of what to research next
Ah, hope you manage to find the resources for what you're looking for anyway =P
It's still not clear what you're actually asking. What part do you have problems with? Drawing a graph or getting the user input? Some time ago i made an expression parser and a sample application. A WebGL build can be found here. The sample application simply uses the expression parser to parse the expression the user enters. It always draws a "curve" of 2000 line segments. All unknown parameters are simply feed with a value between -1 and 1
You may want to edit your question and be more precise what you actually want from us.
Your answer
Follow this Question
Related Questions
Raycast and OnTriggerEnter performance 1 Answer
How to turn real life object into gameobject 1 Answer
Terrain trees 1 Answer
Terminal Typing 0 Answers
immersive and interactive 3D tour 0 Answers