Skip to main content

Portal

Portal.SetOpen(portalGameObjectId, open) changes authored Room connectivity at runtime and returns false when the GameObject has no valid Portal component.

portalGameObjectId = -1

function Start(gameObjectId)
Portal.SetOpen(portalGameObjectId, false)
end

function OpenDoor(gameObjectId)
if not Portal.SetOpen(portalGameObjectId, true) then
Log.Print("Portal could not be opened")
end
end

Portal open state affects the conservative Room visibility graph. It does not automatically animate a door or change its Collider; coordinate those systems from the same gameplay function when required.

See Rooms, Portals, and Navigation.