camera

A follow camera on any creature.

Functions

# camera.follow(creature, distance?)

The camera follows a creature; the mouse orbits around it. The hunter moves with the camera, so creatures may notice him: combine with world.invisible. When it ends (camera.follow(nil), the creature is gone, the scripts unload), the hunter stays where the camera took him: move him back yourself (player.teleport) if he should be where he was.

ParameterType
creatureCreature|nilnil = the hunter's own view again
distance optionalnumberdistance behind it
camera.follow(world.nearest("trex"), 2500)

# camera.following() → Creature|nil

The creature the camera follows.

Returns
Creature|nil

# camera.distance(distance?) → number

Distance of the follow camera (default 1500 plus the creature's size).

ParameterType
distance optionalnumbernew distance
Returns
numberthe distance

# camera.orbit(degreesPerSecond)

Slowly circles the followed creature (for showcases).

ParameterType
degreesPerSecondnumber0 = off