GetWalkSpeed#
- ExportRoom.GetWalkSpeed()#
歩行速度[m/s]を取得します。
- Returns:
歩行速度[m/s]
- Return type:
number
Example#
-- ルーム設定の取得
print("Gravity: "..tostring(vci.vc.room.GetGravity()))
print("WalkSpeed: "..vci.vc.room.GetWalkSpeed())
print("JumpSpeed: "..vci.vc.room.GetJumpSpeed())
print("RoomKey: "..vci.vc.room.GetRoomKey())
-- プレイヤー情報の取得
local players = vci.vc.room.GetAllPlayers()
local currentPlayersString = "Current Players: "
local idToNameMap = {}
for k, v in pairs(players) do
local name = v.GetName()
idToNameMap[v.GetId()] = name
currentPlayersString = currentPlayersString..name..", "
end
print(string.sub(currentPlayersString, 1, -3))
-- ローカルプレイヤーの取得
local localPlayer = vci.vc.room.GetLocalPlayer()
print("local player: "..localPlayer.GetName())
-- 入室時コールバックの登録
vci.vc.room.OnPlayerJoined(
function (joinEvent) -- {"PlayerId": string}
local id = joinEvent["PlayerId"]
local name = vci.vc.room.GetPlayerById(id).GetName()
-- プレイヤーが入室するとコンソールに名前を表示
print(name.." has joined.")
idToNameMap[id] = name
end
)
-- 退出時コールバックの登録
vci.vc.room.OnPlayerLeft(
function (leftEvent) -- {"PlayerId": string}
local id = leftEvent["PlayerId"]
local name = idToNameMap[id]
-- プレイヤーが退出するとコンソールに名前を表示
if name ~= nil then print(name.." has left.") end
idToNameMap[id] = nil
end
)