# How do you calculate max fall speed?

What is the equation used to calculate the max speed in which a character falls due to gravity?

1 Like

Terminal velocity can only be reached when there is a frictional force while the character is falling. There is nothing like this by default that I know of, so the character will keep accelerating forever.
If you wanted to add a drag force the terminal velocity would be:

2 Likes

There are plenty of ways you can calculate the speed of an object in flowlab.
For starters, you can simply extract the current Y velocity using an extractor behavior.
No calculation is needed.

(there is also the option to extract x velocity and plenty more)

Suppose you want to calculate the overall velocity of an object. In that case, you can use the â€śVelocity Calcâ€ť bundle by JR (honestly, the original version & math circled a lot, so letâ€™s say it is just from the community), which extracts both x and y velocity and determines the speed the object is moving.

Velocity Calc Bundle code: (Click multiple times to select all)

``````{"data":{"behavior":{"v":"2","nodes":[{"inputCount":2,"outputCount":1,"name":"Velocity Calc","behaviorType":"logic.NodeGroup","x":-1080,"y":288,"id":"e56c347c691f5b4e","notes":"Calculates this object velocity using magnitude. Bundle by JR01 (slightly changed by PixelPizza)","n_o":1,"isMenuItem":false},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":1620,"y":224,"group":"e56c347c691f5b4e","id":"e56c347ce274ec4d","targetId":0,"prop":"y velocity"},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":1620,"y":128,"group":"e56c347c691f5b4e","id":"e56c347c455d3045","targetId":0,"prop":"x velocity"},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":2160,"y":192,"group":"e56c347c691f5b4e","id":"e56c347c671a164c","portId":"e56c347c691f5b4eo0","tag":"Speed","dataType":2},{"expression":"Math.sqrt(Math.pow(A,2) + Math.pow(B, 2))","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":2,"tag":"","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":1800,"y":192,"group":"e56c347c691f5b4e","id":"e56c347e32e41e4a"},{"expression":"Math.round(A*10)/10","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":2,"tag":"","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":1980,"y":192,"group":"e56c347c691f5b4e","id":"e56c347f5840844e"},{"delay":0,"count":0,"version":2,"inputCount":3,"outputCount":1,"name":"Timer","behaviorType":"logic.triggers.Timer","x":1440,"y":160,"group":"e56c347c691f5b4e","id":"e56c347fa451314f"},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":1260,"y":128,"group":"e56c347c691f5b4e","id":"e56c347ff2784f4b","portId":"e56c347c691f5b4ei0","tag":"on","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":1260,"y":224,"group":"e56c347c691f5b4e","id":"e56c347f3788a844","portId":"e56c347c691f5b4ei1","tag":"off","dataType":2}],"links":[{"input_id":"e56c347e32e41e4ai1","output_id":"e56c347ce274ec4do0"},{"input_id":"e56c347e32e41e4ai2","output_id":"e56c347ce274ec4do0"},{"input_id":"e56c347e32e41e4ai0","output_id":"e56c347c455d3045o0"},{"input_id":"e56c347f5840844ei0","output_id":"e56c347e32e41e4ao0"},{"input_id":"e56c347f5840844ei1","output_id":"e56c347e32e41e4ao0"},{"input_id":"e56c347c671a164ci0","output_id":"e56c347f5840844eo0"},{"input_id":"e56c347c455d3045i0","output_id":"e56c347fa451314fo0"},{"input_id":"e56c347ce274ec4di0","output_id":"e56c347fa451314fo0"},{"input_id":"e56c347fa451314fi0","output_id":"e56c347ff2784f4bo0"},{"input_id":"e56c347fa451314fi1","output_id":"e56c347f3788a844o0"}]}}}
``````

Welcome to flowlab! Hope this helps

5 Likes

Yep, unless you can simulate air resistance in Flowlab, all objects will fall at the same rate of acceleration regardless of mass

1 Like

Ooh nice a distance formula with a rate?

Hmmmm dunno about that tbh. Have you tested it?

1 Like

No, Iâ€™m just assuming that the flowlab physics engine is similar to IRL physics, where if you ignore air resistance everything would have the same force of gravity acting on it (~9.81m/s^2)

You can also give an object artificial gravity by having a constant +Y position on the player so it will always be moving downwards.

So the 9.8 m/s^2 can easily be changed to either a constant, or use an expression/ease to exponentially increase the gravitational force on the player or object.

Considering how small the flowlab play window is, adding a ton of equations and math for such a complex force would be kind of useless since the screen wouldnâ€™t be tall enough (unless it depends on the game youâ€™re making) to even show any change in the objects speed.

2 Likes