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.

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