Foldup
Member
Hello my friends!!! I am not the best with math, I am sorry to say, and I have been struggling.
I want to use a function like LERP to move smoothly between 2 given values: currentwidth and goalwidth for smooth camera zooming.
I thought lerp(currentwidth,goalwidth,.5) was the way to go, but that's to literally give me the 50% value of those two numbers so I'm confused.
Actual code:
Any thoughts?
bracket[width] is an array that contains all the potential camera scaling options. I can just jump between them, but thought it would be nice to do it smoothly.
I want to use a function like LERP to move smoothly between 2 given values: currentwidth and goalwidth for smooth camera zooming.
I thought lerp(currentwidth,goalwidth,.5) was the way to go, but that's to literally give me the 50% value of those two numbers so I'm confused.
Actual code:
GML:
currentwidth = camera_get_view_width(view_camera[0])
camwidth=lerp(currentwidth,bracket[width],.5);
camheight=camwidth/ratio;
bracket[width] is an array that contains all the potential camera scaling options. I can just jump between them, but thought it would be nice to do it smoothly.
Last edited: