- Home /
[ASK] Unity Block Pulse Diagram
I have a problem. In Unity I want to make a pulse block graph like image below.
I am using this tutorial as the basis http://catlikecoding.com/unity/tutorials/graphs/
But as until now the code that I made only capable of making the upper and bottom part, like in this video http://www.youtube.com/watch?v=G2jTR6yGyzM&feature=youtu.be
So anybody know how I can make the side part (the height of the graph)? :)
Here is the little piece of the code:
private float Sine(float x){
float formula = Mathf.PI * x * graphW / graphF + Time.timeSinceLevelLoad;
float sinFormula = Mathf.Sin(formula);
if(sinFormula > 0){
sinFormula = 1;
}
else if(sinFormula < 0){
sinFormula = -1;
}
return (sinFormula / graphH);
}
Here is the code if you want to check http://pastebin.com/5yVcHWM4
Thank you very much :)
that's a neat idea to put " [AS$$anonymous$$] " in the question title
Your answer
Follow this Question
Related Questions
Click and add blocks on a platformer. 1 Answer
Delete Blocks 1 Answer
Unity 2D C# - Creating a Box Out Of Boxes 0 Answers
Browers not allowing Facebook login Pop-up || Unity WEBGL 1 Answer