-
- How can I get the player entity, to get the
*PhysicsAPI.GetLinearVelocity(TrackedPlayer*)
?? - How can I set properly the
*OnPressEvent*
??? - Where could I find coding examples in API?
- How can I get the player entity, to get the
function OnPlayerJoined(playerId)
local player = YaGame:GetPlayer(playerId)
print("player", player:GetId(), "ha joined.")
TrackedPlayer = player
--EventHelper.AddListener(YaInputAPI,"OnKeyDown", OnPressKey)
--local entityPlayer = YaCharacterAPI:GetPlayerEntity(playerId)
local entityPlayer = YaCharacterAPI:GetPlayerEntity(player)
local vp = PhysicsAPI.GetLinearVelocity(TrackedPlayer)
print(entityPlayer, vp)
end
error:
local pe = player:SelfEntity()
print(pe)
error:
local characterEnt = YaCharacterAPI.Character(player)
print(characterEnt)
error:
local entityPlayer = YaCharacterAPI.GetPlayerEntity(player)