How do I get the velocity of a player?

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

How do I get the velocity of a player?

by Wuzzy » Fri Jun 27, 2014 20:54

How do I get the velocity of a player?

I already tried
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
player:getvelocity()

, where “player” is a player object.
But it returns nil.
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: How do I get the velocity of a player?

by Calinou » Fri Jun 27, 2014 21:18

Wuzzy wrote:How do I get the velocity of a player?


I'm sorry Dave, I'm afraid we can't do that: https://github.com/minetest/minetest/issues/1176

However, you can maybe try comparing player positions between two steps.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

Re: How do I get the velocity of a player?

by webdesigner97 » Fri Jun 27, 2014 21:46

Calinou wrote:
Wuzzy wrote:How do I get the velocity of a player?


I'm sorry Dave, I'm afraid we can't do that: https://github.com/minetest/minetest/issues/1176

However, you can maybe try comparing player positions between two steps.

v = Δs / Δt :)
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: How do I get the velocity of a player?

by Wuzzy » Sat Jun 28, 2014 03:52

Too bad I also want to set the velocity of a player. :(
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33

Re: How do I get the velocity of a player?

by hoodedice » Sat Jun 28, 2014 07:40

How about attaching an invisible LuaEntitySAO to the player, and then manipulating that SAO? Kinda hacky, but might work.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 15 guests

cron