SAvatar
服务器场景
成员 6
| 属性 | ID | Avatar's ID |
| 属性 | Position | Avatar's position |
| 属性 | Velocity | Avatar's Velocity |
| 属性 | Rotation | Avatar's Rotation |
| 属性 | Username | Avatar's Username |
| 属性 | Title | Avatar's Title |
属性
ID只读
int ID {get; }
Avatar's ID
示例
Lua
ID = Space.Scene.Avatars[1].ID
Lua
--server script that prints a list of IDs of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].ID)
end
end
Position只读
Vector3 Position {get; }
Avatar's position
示例
Lua
ID = Space.Scene.Avatars[1].Position
Lua
--server script that prints a list of Positions of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Position)
end
end
Velocity只读
Vector3 Velocity {get; }
Avatar's Velocity
示例
Lua
ID = Space.Scene.Avatars[1].Velocity
Lua
--server script that prints a list of Velocitys of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Velocity)
end
end
Rotation只读
Quaternion Rotation {get; }
Avatar's Rotation
示例
Lua
ID = Space.Scene.Avatars[1].Quaternion
Lua
--server script that prints a list of Rotations of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Rotation)
end
end
Username只读
string Username {get; }
Avatar's Username
示例
Lua
ID = Space.Scene.Avatars[1].Username
Lua
--server script that prints a list of Usernames of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Username)
end
end
Title只读
string Title {get; }
Avatar's Title
示例
Lua
ID = Space.Scene.Avatars[1].Title
Lua
--server script that prints a list of Titles of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Title)
end
end



