C
C#2y ago
euphxria

❔ how do you see if a number is passed through per frame

one frame a value may be 93 and a value may be 87 beforehand. 90 is therefore passed through. how do i check if any multiple of 90 including zero is passed through per frame?
35 Replies
Pobiega
Pobiega2y ago
Context?
euphxria
euphxriaOP2y ago
hw
Angius
Angius2y ago
Save the previous value
euphxria
euphxriaOP2y ago
can someone just give me a code example
Angius
Angius2y ago
Check if prev / 90 < curr / 90?
euphxria
euphxriaOP2y ago
so 87/90 < 93/90 ?
Angius
Angius2y ago
In this case, yes
euphxria
euphxriaOP2y ago
does that work for prev = 87 and current = 89
Angius
Angius2y ago
$tias
euphxria
euphxriaOP2y ago
no it doesnt
Pobiega
Pobiega2y ago
I mean, you said, and I quote..
how do i check if any multiple of 90 including zero is passed through per frame
euphxria
euphxriaOP2y ago
maybe it works i dont really understand the syntax im used to basic c#
Angius
Angius2y ago
87 -> 93 => passes through 90 87 -> 89 => does not pass through 90
Pobiega
Pobiega2y ago
^ exactly
euphxria
euphxriaOP2y ago
87/90<89/90 == true
Angius
Angius2y ago
Yeah
euphxria
euphxriaOP2y ago
yet 87 and 89 doees not pass through 90
Angius
Angius2y ago
And 87/90<93/90 is false Just invert the condition then
Pobiega
Pobiega2y ago
I mena it sounds like you just want prev < 90 && curr >= 90
Angius
Angius2y ago
Has to work for multiples including zero
euphxria
euphxriaOP2y ago
yes basically
Angius
Angius2y ago
So 867 -> 921 too So prev / 90 >= curr / 90
euphxria
euphxriaOP2y ago
89/90 >= 91/90?
Angius
Angius2y ago
$tias
Pobiega
Pobiega2y ago
(the answer is no)
euphxria
euphxriaOP2y ago
no its 0.99 and 1.01 amazing help
Angius
Angius2y ago
So which way do you want it? When it's true it's not right When it's false it's not right Do you want it to be maybe?
euphxria
euphxriaOP2y ago
ARE YOU AN AI REPORTED
DaVinki
DaVinki2y ago
We are all AI
Angius
Angius2y ago
Pobiega
Pobiega2y ago
uhm, no? only if prevand curr are floating point numbers it would be 0 and 1 otherwise
Anton
Anton2y ago
I don't understand the question
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server