Can you change a float dynamically in the timeline editor?

I’m working on a isometric game and I would like to be able to zoom the camera in and out. So far I have accomplished this by changing the Ortho Width of the player camera. I made a timeline in which I ‘animate’ the value. This works but comes with a number of problems. I use triggerboxes to activate these timelines. However, when the triggerboxes with different Ortho Width values are activated too close to each other the camera first resets the camera to the default causing it to glitch.

I was wondering if it is possible to make the float I use in the timelines dynamic so that it just proceeds to the value of the next triggerbox’s value, without resetting to default first.

Or is there a simpeler way to achieve this?

May be a stupid question, I’m still new to the blueprint scripting system.

Thanks in advance!

Timelines are probably not the right solution if you want to interrupt half way through. If It’s just two values you can use Play / Reverse inputs to go back and forth, but here’s an easy way to smooth to a target value like you reference.

An easy way to handle this is as follows. Create 3 float variables in the level blueprint. OrthoWidthTarget sets what width you want. Any time you want to change the zoom in / zoom out, just set this variable and everything else will happen automatically.

OrthoWidthCurrent is the current setting - it will change over time to blend towards the target. You should set it and OrthoWidthTarget to the same starting setting.

OrthoWidthBlendSpeed is how fast the zoom in / out happens. Try using a value like ‘5’ or ‘10’, and tune to taste.

1 Like

Ah, I knew there had to be a simpler way :slight_smile:

Thank you very much!