Connecting an interface into set timer by event

delta time is a float value, the time spent since the previous tick. This is tied to FPS. every frame is called a “tick”, so 60 FPS is 60 ticks a second.

If you move object X 10 units per tick, someone playing a game with 60 FPS vs someone playing with 400 FPS will see the object move at different speeds. To ensure that both players regardless of FPS will see object X move at the same speed, the speed is multiplied with world delta seconds.

the “Tick” method provides world delta seconds as function argument. If not using the Tick method, you can access the World Delta Seconds from Gameplay Statics

Get World Delta Seconds | Unreal Engine 5.5 Documentation | Epic Developer Community

Multiply the speed of any effect that requires it.

References:

https://www.youtube.com/watch?v=8DxnRPwZMOs

I must apologize for a mistake I made earlier. Multiplying by world delta seconds is of importance when working with tick, but somehow that info popped up in my mind when it was irrelevant. Tick is very common to smoothly transition A to B, like the arrow position, without stutter. See, the timer event you use runs per X seconds instead of tick.

If you are doing something per tick, you can use the advice I gave. When running per X second (timer) consider my reply a moment of stupidity (or just too much work lately :slight_smile: )

1 Like

in addition to what @Roy_Wierer.Seda145 said is true, that way you can decouple tick time and speed of arrow over time. So you can basically tell actor move 100units over 1 second and it would be same between different FPS machines.

In simpler words you can do this in multiple ways ofcourse :slight_smile: and I honestly feel that I am putting you in the wrong direction just to answer your question since I don’t exactly know the end results you want in a projectile movement. However anything is possible.

If I need to do this custom like you do, What I would do is below

Think we gave already a lot of possible explanations to you, I would like to not to confuse you but feel free if you have questions.

1 Like

Thanks.
isn’t timer by event also bound in time on any device? i was assuming its speed not defendant on FPS

I intent to put each of those arrows in an object pooling, and de-activate them by disable all their systems and also making their timerTick from 0.0222 to something like 10, just to make sure they are not ticking in the pool.

Is the solution you provided not more expensive then the one im trying to apply ? this game is for mobile devices

Still, The explanation you provided me did expanded my knowledge and was valuable to me. thank you.

I landed on 0.022 because it seems like the threshold for smooth enough movement.
i tried to see how low of a number i can get away with for mobile devices. seeing someone demonstrate set timer by event on you tube i was assuming this timer is bound by time and its speed is not dependent on fps or number of ticks per second

Is basically the same you can always stop tick of the actors on runtime if you are pooling them. On the example I didn’t add those since it’s just a demo.

A proper way of doing it is very possible on my example.
-When actor gets in use from pool, you open gate enable tick when it’s on pool you close gate also in addition you can disable ticking too.
-Even its a mobile game ticking of actors with a gate won’t be too significant if you don’t have hundereds of actors ready at pool.

You can write a check function to this as distance reached or collided to return actor to pool.

In addition to use deltatime or deltatime constant is important since tick time is not same for each frame. So in my example interpolation done for basically again for each tick calculating how much of a distance delta should actor receive for that delta time fraction.

You can check deltatime over here why in a visual format.

You can do with timeline, constant time functions, or as u do with a timer too.

1 Like

Thank you again. those answers are super valuable to me. i will also read farther on that in documentation.

Btw, i intend to re-write everything in C++ (first i try to get a game running with blueprints without fatal mistakes)

If i know im gonna use C++ later, what is the solution in BP that are the most similar in C++ does C++ also have the Gate flow control ? or timerByEvent ?

1 Like

You can do everrything in C++ that blueprints does, even much more than that. The correct way to approach UE is to understand wherre to use C++ and when to use blueprints in hybrid mode, depending on the need, complexity, usability. Think that hybrid mix of BP and C++ comes after having a fair enough programming knowledge and knowledge base.

2 Likes

In my case I do everything in C++ until one asset requires an editor for non programmers to be made. This is common in widget design. Then C++ is the base class implementing 100% of the core functionality, and widget designers inherit from that class to inject their designs onto the core functionality. “BindWidget” is used for that on the UPROPERTY. Same types of injection can be done in other types of assets. C++ == the functionality, Blueprints == the visual variants of that class.

I never start something serious in blueprints before I start working in C++, because blueprint data, structs, enums etc as well, can not be easily (or not at all) be ported to C++ at times, or takes a lot of effort to do.

Blueprint scripting also comes with a bunch of limitations on C++ programming concepts which are possible just in C++. like templating or accessing engine methods that are not exposed to blueprint. It’s also easier to work with references (pointer type) there. + because it’s all text you can work with version control and those text files never ever corrupt. Blueprints corrupt easily and are binary so you can’t use version control like Git with blueprints without having to upload megabytes of data per commit.

in C++ that would just be a boolean property, and optionally you’d add a method to set and toggle it.

bool bCanContinue = true;

if (bCanContinue) {
  // do stuff
}

There’s no need to create such nodes in the first place. The gate node, do once etc. in BP is more of a quick prototyping addition so you don’t have to add any tracking property manually.

2 Likes

Thank you @Roy_Wierer.Seda145 and @RedGrimnir i read both your explanations and it make sense to me. i was using C# with unity for few years and i will dive into C++. i never liked blueprints and forced myself into that when starting unreal. looking backwards it might have been a mistake, maybe i should have started with C++

1 Like