How can I make my parallax scrolling blueprint frame-rate independant?

Okay, so I know that delta time is used to keep things independent of the framerate. However, I have no idea how to implement it in this blueprint I made for parallax scrolling of background elements for my game. Here’s the blueprint:

http://i.imgur.com/eVkcJmV.png

So every tick, it moves the background element relative to the player’s velocity and a speed variable. However, when I have a lower frame rate, the parallax scrolls slower (to the point that it’s not even noticeable.) I guess I don’t understand enough about how delta time works, how would I even implement it here? Thank you!

Multiplying the “Character Velocity” by “Delta Seconds” and adjusting the “Parallax Speed” should be enough,
note that you should also execute the “Cast To sidescroll_Player” in the Tick event.

I already tried that, and even after adjusting the value so it wasn’t insanely fast anymore, it still becomes slower when I lower the frame rate. I seriously have no idea why.

Also, are you sure I should be casting every tick? It works perfectly fine as is.

Edit: OH SHOOT. I misread your comment. I just tried it with the character’s velocity and it works! Thanks dude!

That’s what I did, it only casts once on begin play. I didn’t feel the need to promote it to a variable though, and to my knowledge that wouldn’t make any difference performance wise.

In programming casting can be very expensive. I doubt it’s any different in UE4. Make one cast on begin play and save the result in a variable.

I’m not sure if UE4 stores the variable or if it performs the cast each time event tick is called. I’d be weary though as casting is indeed quite expensive when you start doing more things with the code.

It may only be casting once and then pulling the result from memory. I know with functions if it’s pure the function is called anytime you make use of the return variable. So given the example image below the function would actually be called twice. But non-pure functions which use the exec pin are only called once; that being said your method may only be getting called once.

Either way you’re better off using a variable. It’s cleaner and when you expand you’ll end up doing so anyway. It’s proper technique and you’ll thank me later when your code is a lot easier to follow as it grows.

Good point. I did what you suggested just in case. Thanks for your input!