#How do I make my own rotator
1 messages · Page 1 of 1 (latest)
Just use rotator
Or animation
bro I just said I want to calculate it using math or smthing
hmm I will test that out but I still need to make it with math
My calculate it with math, do you mean like just how fast it spins?
Just like how the vector math can make something move in smaller portions I need it for the rotation
This is for the position
it doesnt set velocity or anything it just normalizes the goal position and constantly adds it to the object
Get Rotation(Object) * Quaternion Create Angle Axis((1, 0, 0), Degrees Per Sec * Delta Time)
By y axis, i assume u mean up/down. & that would be the pitch (x) axis
oh no I meant right left but still this will work for both I believe
imma test it rq
ye, right/left is yaw (y) axis. So then u would put the y axis in the axis for the create angle axis
thats a quaternion create, not a quaternion create angle axis
k thx
other than not including delta time
took me 3 days lol chtgpt sucks
I need it
ah alr
also remember:
- true delta time = time based
- pefect delta = visually based
true, perfect is 1/Hz. A constant value. Allows you to input known metrics that scales to execution so u dont need to try do the scaling yourself every time you change Hz
When stuck on a frame showing a monster 10 meters away. Then a long time passes before next frame renders:
- true will: have the monster on top of u before u can even see it, bc according to actual time, that's where the monster should be. unfair, & jarring/sudden when lags
- perfect will: have the monster move the expected amount
@autumn niche
I see
nah i dont
but they are the same
they will both do the same when a frame freezes will they not? the player wont see a differens
nah
- true delta is: New frame time - last frame time
- perfect delta is: 1/Hz
so perfect delta is not using time delta in unity?
when true lags, everthing jumps ahead in time before u can see it. when perfect lags, everything just moves the same ammount as if there wasnt lag
yee
so basically higher frames in perfect means faster rotation
If the speed is the same for all players
i prefer perfect, its more fair & less sudden. But typically i just use true delta for prototypes or examples bc its more convient to wire in whats already there instead spawning a new chip & entering 2 values 
thats without delta scaling. If u just put whatever value that works out to be your desired meters, its will be fast for slower frames & faster for faster frames
when u scale by delta, that value is scaled to match what that measurment would be in that frequency
but completely disregards frequency & becomes based on time instead frames/frequency when u use true
Im sweating so hard trying to understand this
Hz is how many signals a second
(in a perfect world)
if you add 2 to a variable at 30Hz, by the time a second passes, 60 would have been added to that variable. if u do the same with 60 hz, there would be 120 added to that variable
if you scale whats added by "The measurement * (1/30)" (0.3...) (0.06... with the measurement 2) then when ran by the 60Hz, only 60 would be added to the variable instead 120
@autumn niche
OMHGG Finally I get it
yee
i send 30 instead 2 as the value for true & perfect since that was the actual goal, just so happens without scaling, adding 2 at 30Hz gets to 30 n such
as u can see, true is alot more what you expect, & stable. Whereas time is very unstable. Of course the examples dont match up perfectly, but thats just the imperfections in the world
or i geuss 60 would have been the goal, but ye. kinda stoned atm 
Dont forget, if your never using a different frequency, u can just hard code "The measument * (1/ Hz)" since 1/Hz is static too
I get it but why do you use perfect more often? isnt it bad cuz if you do calculations with it, it will break if the players device cant keep up with the hz
aussuming u mean "why DONT you"
or u mean true
😭
stoned
i have lil gummy sharks rn
perfect is bad if I add 1 with a 30hz cuz if the player has 20 fps than it will only add 20
and thats not what anyone wants or is it?
so in this case wouldnt it be better to use true
yea+
I need it to be 30 I mean thats always the goal if you use a 30 hz to add 1
no, bc if the time between frames is long, the thing will jump to rotations instead the next amount the next time the next frame comes
i said to add 2
you can just multiply it after
like say u pick a random frequency, u have no idea what it is, It makes the number add up to the amount you want it to, after 1 second
But then u change the frequency to one you know/desire, now the amount no longer adds up to what you wanted. So u have to scale the amount it would reach without scaling * true or perfect
okay mb I just understood it
its a example, just to see how it works
okay perfect is better
but what about the thing I said where the players device doesnt keep up?
is there no fix for it?
ye, i personally always thought i was bullshit when a monster would teleport to me bc lag since it was time based instead frame based
no, the constraint time is 1 second, the only way to "fix it" is by having the time be based on the frequency but that dosent makes sense bc u need a grounded metric or something
like, you saying i wanna measure 1 inch, but i was only able to put my ruler at 0.5 inch, lets stretch space so that 1 inch is now 0.5 inch to satify our goal
I see
or I could just manually give every single frame rate its own number that adds like a mad man
in our example, thats like adding, if the counter is not the expected 30, say it hit 30 anyways. So if the time was lower or higher, it would still jump & be inaccurate bc thats not what the counter was given the 1 second constraint
that would assume u know the future, an thus those delta time scalings for the next n frames. Being impossibly precise. As if knowing the future wasnt impossible as is
mhm 
but ye, i would do perfect, especially nice since u can hardcode it if u will never change frequency n stuff
alr have 
some mi mexico, this one there deserts. & the previously mentioned gummy sharks 