Rev | Line | |
---|
[4547] | 1 | trigger = ScriptTrigger() -- Create the trigger |
---|
| 2 | trigger:setScript("cutscene.lua") -- Tell the trigger which script to call |
---|
| 3 | trigger:setFunction("tick") -- Tell the trigger which scriptfunction to call |
---|
| 4 | trigger:setActiveOnCreation(true) -- Let the trigger call the script as soon as it is created until |
---|
| 5 | |
---|
| 6 | -- Get objects from orxonox |
---|
| 7 | thisscript:addObject("CameraMan", "cameraManager") |
---|
| 8 | |
---|
| 9 | |
---|
[4549] | 10 | time = 0 |
---|
| 11 | cameraSwitched = false |
---|
| 12 | |
---|
[4547] | 13 | -- THE tick function |
---|
| 14 | |
---|
[4553] | 15 | function tick(timestep) |
---|
[4549] | 16 | time = time + timestep |
---|
| 17 | |
---|
[4553] | 18 | cameraManager:setCam("CameraOne") |
---|
| 19 | cameraManager:changeCurrTarget( "Planet", "Moon") |
---|
[4547] | 20 | return true |
---|
[4549] | 21 | |
---|
[4553] | 22 | --if time > 2 and not cameraSwitched then |
---|
| 23 | --cameraSwitched = true |
---|
| 24 | --end |
---|
| 25 | |
---|
| 26 | --if time > 4 then |
---|
| 27 | ---cameraManager:togglFade() |
---|
| 28 | --return true |
---|
| 29 | --end |
---|
| 30 | |
---|
| 31 | --return false |
---|
[4547] | 32 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.