moonfall/Assets/Scripts/WorldDefault.lua
2014-10-21 13:54:42 +09:00

16 lines
406 B
Lua

function OnWorldCreate(parameters)
local spawnId = nil
if parameters.spawn == nil then
spawnId = ActorFromName("spawnDefault")
else
spawnId = ActorFromName(parameters.spawn)
end
if spawnId ~= nil then
playerId = ActorScriptSendMessage(spawnId, "spawn").playerId
if playerId ~= nil then
CameraSetTargetActor(playerId)
end
end
end