Skip to content

Commit 5ebb423

Browse files
Elia Argentieriest31
Elia Argentieri
authored andcommitted
Added get_player_velocity() method. Fixes #1176
1 parent 7bbb9b0 commit 5ebb423

File tree

3 files changed

+92
-72
lines changed

3 files changed

+92
-72
lines changed

doc/lua_api.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2470,6 +2470,7 @@ This is basically a reference to a C++ `ServerActiveObject`
24702470

24712471
##### Player-only (no-op for other objects)
24722472
* `get_player_name()`: returns `""` if is not a player
2473+
* `get_player_velocity()`: returns `nil` if is not a player otherwise a table {x, y, z} representing the player's instantaneous velocity in nodes/s
24732474
* `get_look_dir()`: get camera direction as a unit vector
24742475
* `get_look_pitch()`: pitch in radians
24752476
* `get_look_yaw()`: yaw in radians (wraps around pretty randomly as of now)

0 commit comments

Comments
 (0)