CameraChange¶
A trigger zone to change the camera's properties.
Data Arrays¶
data[0]: If 1, thecamoffsetis changed by this object when triggereddata[1]: If 1, the map camera limits are changed by this object when triggereddata[2]: If 1, thecamspeedis changed by this object when triggereddata[3]: If 1, thecamangleoffsetis changed by this object when triggereddata[4]: If 1, thecamtargetis changed by this object when triggereddata[5]: The entity id whose entity's transform is the value thecamtargetwill be set to whendata[4]is 1data[6]: If 1, thecamtargetposis changed by this object when triggereddata[7]: If 1, thecamanglespeedis changed by this object when triggered. This is optionalvectordata[0]: Thecamoffsetto 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,camlimitposandcamlimitnegare 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,camlimitposandcamlimitnegare reset to default when this is triggered anddata[1]is truevectordata[3].x: Thecamspeedto set ifdata[2]is 1 which will also setchangecamspeedto truevectordata[3].y: Thecamanglespeedto set ifdata[7]is 1 which will also setcamanglechangeto truevectordata[4]: Thecamangleoffsetto set to ifdata[3]is 1vectordata[5]: Thecamtargetposto set to ifdata[6]is 1
Setup¶
A few adjustements occurs:
- The entity.
alwaysactiveis set to true - The gameObject's isStatic is set to true
- The entity.
rigidis placed in kinematic mode without gravity nointeractis set to true- The layer is set to 0 (default)
- The
scolis 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.