I am really confused why we need tau variable I think I dont need a tau variable for code to work its change nothing. I leave my code below with Rickin’s code both give the same result.
Hi Nucrow,
For our game and the movement, it does not matter but if you are interested in cycles, you “need” tau
because 1 full cycle is 2 pi. See this diagram.
Mathf.Sin always returns a value between -1 and 1, no matter what you put inside the parentheses.That value affects the frequency. In the context of our game, the frequency corresponds with the speed of our oscillating game object.
Did this clear it up for you?
See also:
- Forum User Guides : How to mark a topic as solved
Thanks for reply, I know what you want to say but, why did Rick need to change the frequency with tau, we can change period value in Inspector if we want change frequency and speed.
So tau in this case just a number which value is 6.28… isn’t it ? Why is this speed important that this value gives us ?
Did you take a look at the diagram? How many seconds are 2pi? The answer is “none”. The sine function does not have anything to do with time. We somehow “need” to make 2pi correspond with 1 second. If 2pi represents 1 second, we do not have to do the maths if we want our object to move, for example, 2 full cycles per second or 0.5 cycles per second.
I found this answer on the internet which explains the idea behind Rick’s algorithm. Have you already seen it?
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.