Adding force independent of framerate in a loop.

Hello

So I’m very new to this whole blueprint system. But I want to add force to a ball.

As you can see in this image here: http://puu.sh/pY8BT/40fc577446.png

Once I enter the trigger box, the ball will have some force added to it. But this, apparently is only added in one frame.

How do I make a loop? Also, how do I make a loop that works independently of the framerate?

Thanks!

Can you please clarify when you say, “independently of the framerate”?

Also you are correct that it would only be called in one frame. On enter, leave, overlap, and so on only call once when the event happens, but not persist.

The most common way might be to set a boolean variable when you enter the trigger area, then on Event Tick check if boolean = true, then add force. You’ll probably need to tune the force down a little.

In my example I’ve demonstrated what I described, as well did it a little differently for your reference. I made my sphere a blueprint actor, and put a triggerbox in the level and gave it the tag “ForceTrigger”.

Video: - YouTube
Image:

Sweet, using your image I managed to make this for myself which seemed to have given a constant force to the ball as long as I stayed in the box!

http://puu.sh/pYeve/b807921b39.png

Question is, will the ball now go faster or slower depending on how high my framerate is?

Thanks!

Add Force and Add Force At Location automatically account for Delta Time, so you need not do any extra work.

Also an extra note, you don’t NEED to use Accel Change but you would need more force without it. Also without Accel Change the force you’re applying will have to fight any opposing force or velocity already on the object. You can get the objects velocity though to determine how much additional force to use if you want to go that route.

If you want to manually perform the frame management you would do something like this with Add Impulse…

image:

If this worked out for you and answered all your questions please mark as solved for others. If you have other questions about this problem feel free to reply.