CameraChange¶
A trigger zone to change the camera's properties.
Data Arrays¶
data[0]
: If 1, thecamoffset
is changed by this object when triggereddata[1]
: If 1, the map camera limits are changed by this object when triggereddata[2]
: If 1, thecamspeed
is changed by this object when triggereddata[3]
: If 1, thecamangleoffset
is changed by this object when triggereddata[4]
: If 1, thecamtarget
is changed by this object when triggereddata[5]
: The entity id whose entity's transform is the value thecamtarget
will be set to whendata[4]
is 1data[6]
: If 1, thecamtargetpos
is changed by this object when triggereddata[7]
: If 1, thecamanglespeed
is changed by this object when triggered. This is optionalvectordata[0]
: Thecamoffset
to set ifdata[0]
is 1vectordata[1]
: The mapcamlimitpos
(upper limit bound) to set ifdata[1]
is true. NOTE: if the magnitude isn't above 0.1,camlimitpos
andcamlimitneg
are reset to default when this is triggered anddata[1]
is truevectordata[2]
: The mapcamlimitneg
(lower limit bound) to set ifdata[1]
is true. NOTE: if the magnitude isn't above 0.1,camlimitpos
andcamlimitneg
are reset to default when this is triggered anddata[1]
is truevectordata[3].x
: Thecamspeed
to set ifdata[2]
is 1 which will also setchangecamspeed
to truevectordata[3].y
: Thecamanglespeed
to set ifdata[7]
is 1 which will also setcamanglechange
to truevectordata[4]
: Thecamangleoffset
to set to ifdata[3]
is 1vectordata[5]
: Thecamtargetpos
to set to ifdata[6]
is 1
Setup¶
A few adjustements occurs:
- The entity.
alwaysactive
is set to true - The gameObject's isStatic is set to true
- The entity.
rigid
is placed in kinematic mode without gravity nointeract
is set to true- The layer is set to 0 (default)
- The
scol
is disabled
Update¶
If the timer
hasn't expired yet, it is decremented by the game's frametime clamped from 0.0 to infinity. Otherwise, if it is 0.0 and the entity isn't dead
, a Death coroutine is started with the entity.
OnTriggerStay¶
This does nothing if any of the following is true:
- The other gameObject isn't the player
- The player isn't free (ignoring flying) and its entity is not
digging
If the above conditions are fufilled, the camera data is changed accoriding to the data logic described above.