# Smooth slider with camera

**URL:** <https://forums.unrealengine.com/t/smooth-slider-with-camera/486658>\
**Category:** Cinematics & Media\
**Tags:** timeline, rig, interpolation, unreal-engine, question, Blueprint\
**Created:** [July 27, 2021, 1:00pm UTC](https://forums.unrealengine.com/t/smooth-slider-with-camera/486658 "2021-07-27T13:00:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanptentsov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ivanptentsov](https://forums.unrealengine.com/u/ivanptentsov)\
**Post date:** [July 27, 2021, 1:00pm UTC](https://forums.unrealengine.com/t/smooth-slider-with-camera/486658/1 "2021-07-27T13:00:29Z")

</div>

Hello everyone. I have a slider with a camera, which, like in a TV show, should ride on rails at the touch of a button. Once I pressed it, I went to the right. The second time I pressed it, I stopped. If I pressed it again , I continued moving from the moment where I stopped. If the slider has reached the end, then it has stopped itself. If I press the button again at this moment , it will start moving in the opposite direction. The problem is that I can’t make the stops smooth. Now I have made it so that everything works, but the camera does not stop smoothly. I would like to have an easy in easy out effect, the camera movement looked natural. I think that we need to do this somehow without using timelines (in which I now have a value from 0 to 1 in 2 seconds). That is, it should be some kind of line, from 0 to 1 (from the beginning of the slider to its end), and the speed of movement, which is interpolated from 0 to 1. When I press the button, the speed increases smoothly to 1 and the camera moves along the slider at the same speed, gradually increasing to 1. And so on. Help with advice, thank you.

 ![344938-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/6/4a60bd688fc538411b616135e69dfb0516faba31.png)

---

<div class="post-metadata">

**Author:** ![Micky](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Micky](https://forums.unrealengine.com/u/Micky)\
**Post date:** [July 27, 2021, 1:25pm UTC](https://forums.unrealengine.com/t/smooth-slider-with-camera/486658/2 "2021-07-27T13:25:45Z")

</div>

Well, there are a bunch of ways to do that.  
A posibility is create a variable “camera\_speed” with values between 0 and 1. This variable is controlled by a timeline, like you did on your code, width the play and reverse to change the speed.  
In a diferent function or event controlled by the tick or a set timer by function name, you can add this speed to your current position on rail. ( probably you need a multiplier modifier of the speed to adjust the real speed of the camera)  
Then just control if the position off the rail has reached the end or the start to change direction, just multiplying your velociti by -1.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/2/7e2ab384680f7c52da8643609b7246ea4293a7ec.jpeg)

In the example, of course i am just changing the value of curren\_position\_on\_rail, you need the change the real position of the camera using this value !

---

<div class="post-metadata">

**Author:** ![ivanptentsov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ivanptentsov](https://forums.unrealengine.com/u/ivanptentsov)\
**Post date:** [July 28, 2021, 7:43am UTC](https://forums.unrealengine.com/t/smooth-slider-with-camera/486658/3 "2021-07-28T07:43:23Z")

</div>

Thanks Micky. But your example does not work out what I need. If the button is pressed once (do not press and hold it), then the movement of the slider starts at a speed of 0 and gradually increases to 1. If the button is pressed again, the speed of the slider smoothly descends from 1 to 0. That’s what I mean.

---

<div class="post-metadata">

**Author:** ![ivanptentsov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ivanptentsov](https://forums.unrealengine.com/u/ivanptentsov)\
**Post date:** [July 28, 2021, 7:45am UTC](https://forums.unrealengine.com/t/smooth-slider-with-camera/486658/4 "2021-07-28T07:45:47Z")

</div>

If we were looking at the example of electrical engineering, I would say that this is how the attenuation of electricity through a capacitor works. How are the schemes for smooth ignition of LEDs implemented, for example. If you know what I mean.
