Hello. I’m sure this question has been asked before or maybe not… I’m confused why we are dividing
" Time.time / period
" (I just don’t get it) why just not use " Time.time
".
Also why are we using Tau
, why don’t we just use a specific number?
And how does the " cycles * tau
" work if the Sin returns -1 or 1
.
I used a different code which works the same(either I’m blind and can’t see the difference or it actually does work the same)
[SerializeField] float amplitude = 2f;
[SerializeField] float frequency = 2f;
movementFactor = Mathf.Sin(Time.time * frequency) * amplitude;
This leads to the same effect but without weird PI's or Time.time / period
.
Maybe someone can explain more in detail why the code provided by this course is superior.