#Is there a better way to do this
1 messages · Page 1 of 1 (latest)
Lerping shouldn't be necessary if you're multiplying by delta time, which you are. What is "not smooth" about the movement, can I see a gif
I mean like
Wiat
ill get a gif later
no u
What?
very sorry i forgot about this
i dont have a gif unfortunately
but by "not smooth", i mean that it snaps to the position
lets say it changes elevation, itll just snap to the ground instead of smoothly falling
Maybe instead of relying on collision to stop the fall then you could apply some counter force against falling when you're a certain height from the ground so it appears smoother. Lerping is always gonna end up slower because it's approximating
I guess instead of using constant speed, which is inherently snappy because it's constant, you could apply force calculation with a maximum velocity limit
so just do basic acceleration for the position instead of constant speed, you can write to an attribute for velocity, or use roblox's deprecated Velocity or however you wanna handle keeping track of it
i forgot to mention
but this doesnt use physics
it checks elevation by raycasting and then changes accordingly
it moves by cframing itself
so it doesnt really "fall", it just snaps to the ground
bump
What I was really suggesting is basically that you completely do away with the constant speed approach because it's inherently snappy and do custom physics
If you just want it to not be snappy when you're detecting the ground, you should go about aligning to the ground differently. Move faster if you're above the ground a decent amount, "decelerate" when you're within stopping range. Would probably only do that for falling motions and not for rising motions, snappy should be fine if it's going up an incline
hmm