Changing Value

Hello,

Let’s start off with a Blueprint sample first;

3e533084c9bc9e2f89291354ef1473bcadf10f64.jpeg

Now what this obviously does, is rotate 1 Frame, at the Speed of ‘3’, when the ‘F’ key is being pressed.

What I am trying to do is making the object accelerate from ‘0’ up to ‘3’ over (For example) 10 seconds, while (For as long as) ‘F’ is being held down.

Would this be something easy to make using Blueprints? I’ve been looking for a couple of hours on the Forum, but couldn’t find anything useful regarding this.

Thanks!

Heya Oovee,

Here’s the simple “use a counter” way:


Personally I think I’d use a timeline to give you an acceleration multiplier then have the press “play” and the release “reverse” it so you could get both acceleration and deceleration. Now that I’m thinking about it, I may put that together now…

Edit:

So the timeline one ends up being way smaller:


The time line is a single float track, 10 seconds long, and goes from 0-1. When you press the F key, it plays, when you release, it reverses from where ever it is in the timeline. The Event Tick is needed because after you hit the end of the timeline, Update no longer executes.

See the Timeline Documentation for more information on them =)

Oh awesome, that would be super! I’m also looking for a function to decelerate with another key :slight_smile:

All you’d have to do to decelerate with another key is to wire the releases into stop, and the other key’s pressed into reverse: