Blueprint Help

Hi.

I took this script from one of the tutorials which basically has me run over an actor and I get a speed boost. I then said, HEY! why don’t I put a delay on it and set the speed back down to 500…! But, I can’t seem to get the second part to work. I’m doing something wrong, any clues would be helpful. Thanks!

  • teak

What happens when you try? Could be because the actor is destroyed by the time the delay is supposed to end. If so, you might want to move the delay and reset functionality into the character itself.

Timeline is what you are looking for. Check out these images and I’ll explain them a little. Keep in mind, this is a simplistic setup but with a little creativity you should easily be able to adapt this to your needs:

Although I use the ‘F’ key to trigger, you would put the timeline after your boost is picked up. Coming out of the time line I called “Speed Out” and hooked a Set Variable to the “Update” execution pin and have the “Speed Out” plugged into the variable. Time line I set to 5 seconds long. Put the rest of your code (if any) into the “Finished” execution pin and once the timeline is done, that section of code will be executed.

This is a very simple timeline. I put a key (right-click the graph area) and set it’s value to 600 and time I set to 4.99. This will maintain a value of 600 for 4.99 seconds. Then I put another key and put it at 5 seconds with a value of 500 so when the timeline is finished - which in your case the speed boost would be used up - it would return the speed to 500. Now obviously you wouldn’t want to use a variable on the out/update pins but rather you could simply have it update the player/character speed directly.

Again, this is very simplistic but will give you the desired results. A little ingenuity will go a long way with this to create different effects. For instance, instead of putting the first key at 4.99 second mark, you could put it at 2.5 seconds and it will slowly interpolate down to 500 over the remaining 2.5 seconds which would give your character a ramp down to normal speed.

Hope this helps! If it does, please accept the answer by clicking the check mark under the arrows next to the answer. You’ll know you got it right when the answer highlights green. If you got any further question let me know but ask them before you accept the answer. Epic has this setup so if I answer back to you after you accept it, it will remove the accepted state of the answer. Thanks!

Your problem is that you destroy the actor, before the delay. Since the actor gets destroyed at the DestroyActor node, the Delay and SetMaxWalkSpeed nodes never get executed.

What you should do instead, is make the actor invisible, so it appears to be deleted, but isn’t. Then the delay will run, and set the walk speed back. After resetting walk speed, you destroy the actor.

Also make sure you don’t process further overlaps.

Using a timeline for this is overly complicated for such a simple task.

Thank you for taking the time to answer…

I think I get it… Even though the actor in question is NOT the player character (its the chair), since it got destroyed the action pin (white) doesn’t continue to the next node? Is that correct…?

I’ll try it tonight when I get home from work…

Thanks for taking the time to answer… Going to try the below suggestion, have not reviewed the timeline just yet.

That worked perfectly… I also reduced the speed slow down with a delay so it doesn’t look like an abrupt slow down. Really cool! Thanks again.

You’re welcome