Limit falling speed

Post Reply
User avatar
Extex
Member
Posts: 190
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Limit falling speed

by Extex » Post

Is there someway to limit how fast the player falls?
Player of PK, RIP. Creator of the light_tool and motorbike mods. Working on another mod which should be coming soon!

Skamiz Kazzarch
Member
Posts: 166
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Limit falling speed

by Skamiz Kazzarch » Post

I immagine you could use get_player_velocity() in globalstep to find out the current speed and if it's too fast use add_player_velocity() to slow the player down.
Relevant lua api: https://github.com/minetest/minetest/bl ... .txt#L5673

Though I suspect it would still be somewhat janky it would probably prevent these situations where you are falling several hundres of block per second.

warpnarget
Member
Posts: 15
Joined: Sat Oct 12, 2019 21:34
In-game: warpnarget

Re: Limit falling speed

by warpnarget » Post

what if someone likes falling hundreds of blocks per second

User avatar
Linuxdirk
Member
Posts: 2637
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Limit falling speed

by Linuxdirk » Post

Lower gravity by using the set_physics_override function for that player.

https://github.com/minetest/minetest/bl ... 5748-L5758

Skamiz Kazzarch
Member
Posts: 166
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Limit falling speed

by Skamiz Kazzarch » Post

Derp, didn't even thought of that.
That should certainly slow down the initial fall, but will it stop it stop the player from acumulating those stupidly large speeds over large distances?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest