As seen in the image below, I’m setting the scale of an object depending on where a person is standing. The data is received through OSC. The function works as expected, however, there is an initial jump in the value when a person is detected. When the OSC is activated, if the original scale value isn’t set to the mapped value, the abrupt jump happens. How do I fix this issue?
Correct me if I’m wrong, you want to change planet size smoother? Does lerp supposed to do that?
Hi, yes. And it does work to an extent, but when the game is in play, the scale abruptly changes whenever the osc data is sent across.
You can do it two ways, with tick and FInterp. Or with timeline. Which one you like?
Do timeline since its FPS independent (or supposed to be anyway).
Otherwise faster graphycs will eventually just jump again…
Note:
The proper way to do this is to flag a planet as scaled or not scaled, and run specific intial code when it isn’t scaled which is then not ran again until the scaled value is reset.
I’m a beginner, so I’m not sure which works the best? Is Flerp available in UE5.2?
It’s F Interp. But as @MostHost_LA said, you can use timeline.
sorry, could you please you elaborate further? I’m using a sequence which essentially loops, and when OSC is received at that point in the scene, the scale function is called.
Not sure how to elaborate any further.
Create a boolean, set the default value to false.
Run the timeline, scale the object, then toggle the boolean.
Precede running the timeline with a branch that checks if the boolean is true or false.
whenever your planet/object exits or reset it’s scale, then toggle the boolean back to false.