Portal
Posted: Sat Dec 13, 2014 6:40 pm
Hi does anyone know how the Portal Object works? I though it was like a Teleport with set coordinates. I walk through it but just a white screen lol, Thank you for any help on this 

Code: Select all
defineObject{
name = "portal",
components = {
{
class = "Model",
name = "frame",
model = "assets/models/env/portal_frame.fbx",
staticShadow = true,
},
{
class = "Portal",
onArrival = function()
GameMode.completeGame("assets/videos/outro1.ivf")
end,
},
{
class = "Light",
offset = vec(0, 1, 0),
type = "point",
color = vec(0.9, 1.0, 1.3),
brightness = 12,
range = 6,
castShadow = true,
onUpdate = function(self)
local noise = math.noise(Time.currentTime()*1 + 123) * 0.5 + 0.9
self:setBrightness(noise * 15)
end,
},
{
class = "Particle",
particleSystem = "portal_particles",
emitterMesh = "assets/models/env/portal_rim_emitter.fbx",
},
{
class = "Particle",
name = "particle2",
particleSystem = "portal_particles_radial",
emitterMesh = "assets/models/env/portal_radial_emitter.fbx",
},
{
class = "Particle",
name = "shipSymbol",
particleSystem = "portal_particles_island",
emitterMesh = "assets/models/env/portal_ship_emitter.fbx",
},
{
class = "Model",
name = "portalBeam",
model = "assets/models/env/portal_beam.fbx",
},
{
class = "Model",
name = "planeModel",
model = "assets/models/env/portal_plane.fbx",
},
{
class = "Controller",
onDeactivate = function(self)
self.go.portal:disable()
self.go.light:disable()
self.go.particle:disable()
self.go.particle2:disable()
self.go.shipSymbol:disable()
self.go.portalBeam:disable()
self.go.planeModel:disable()
end,
},
},
placement = "wall",
tags = { "door" },
editorIcon = 124,
automapIcon = 84,
}