Add this script to a platform and it'll fall down when walked upon by a playable character Add an AutoRespawn component to your platform and it'll get reset when your character dies.
More...
|
| FallingPlatformStates | State |
| | the platform's current state
|
| bool | InevitableFall = false |
| | if this is true, the platform will fall inevitably once touched
|
| float | TimeBeforeFall = 2f |
| | the time (in seconds) before the fall of the platform
|
| bool | UsePhysics = true |
| | if this is true, the object's rigidbody will be turned non kinematic when falling. Only works in 3D.
|
| float | NonPhysicsFallSpeed = 2f |
| | the speed at which the platforms falls
|
|
| virtual void | Start () |
| | Initialization.
|
| virtual void | Initialization () |
| | Grabs components and saves initial position and timer.
|
| virtual void | FixedUpdate () |
| | This is called every frame.
|
| virtual void | DisableFallingPlatform () |
| | Disables the falling platform. We're not destroying it, so we can revive it on respawn.
|
| virtual void | UpdateAnimator () |
| | Updates the block's animator.
|
| virtual void | OnTriggerExit (Collider collider) |
| | Triggered when a TopDownController exits the platform.
|
| virtual void | OnRevive () |
| | On Revive we restore this platform's state.
|
Add this script to a platform and it'll fall down when walked upon by a playable character Add an AutoRespawn component to your platform and it'll get reset when your character dies.
◆ FallingPlatformStates
the possible states for the platform
| Enumerator |
|---|
| Idle | |
| Shaking | |
| Falling | |
◆ DisableFallingPlatform()
| virtual void MoreMountains.TopDownEngine.FallingPlatform3D.DisableFallingPlatform |
( |
| ) |
|
|
protectedvirtual |
Disables the falling platform. We're not destroying it, so we can revive it on respawn.
◆ FixedUpdate()
| virtual void MoreMountains.TopDownEngine.FallingPlatform3D.FixedUpdate |
( |
| ) |
|
|
protectedvirtual |
This is called every frame.
◆ Initialization()
| virtual void MoreMountains.TopDownEngine.FallingPlatform3D.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs components and saves initial position and timer.
◆ OnRevive()
| virtual void MoreMountains.TopDownEngine.FallingPlatform3D.OnRevive |
( |
| ) |
|
|
protectedvirtual |
On Revive we restore this platform's state.
◆ OnTriggerExit()
| virtual void MoreMountains.TopDownEngine.FallingPlatform3D.OnTriggerExit |
( |
Collider | collider | ) |
|
|
protectedvirtual |
Triggered when a TopDownController exits the platform.
- Parameters
-
| controller | The TopDown controller that collides with the platform. |
◆ OnTriggerStay()
| virtual void MoreMountains.TopDownEngine.FallingPlatform3D.OnTriggerStay |
( |
Collider | collider | ) |
|
|
virtual |
Triggered when a TopDownController touches the platform.
- Parameters
-
| controller | The TopDown controller that collides with the platform. |
◆ Start()
| virtual void MoreMountains.TopDownEngine.FallingPlatform3D.Start |
( |
| ) |
|
|
protectedvirtual |
◆ UpdateAnimator()
| virtual void MoreMountains.TopDownEngine.FallingPlatform3D.UpdateAnimator |
( |
| ) |
|
|
protectedvirtual |
Updates the block's animator.
◆ _animator
| Animator MoreMountains.TopDownEngine.FallingPlatform3D._animator |
|
protected |
◆ _bounds
| Bounds MoreMountains.TopDownEngine.FallingPlatform3D._bounds |
|
protected |
◆ _collider
| Collider MoreMountains.TopDownEngine.FallingPlatform3D._collider |
|
protected |
◆ _contact
| bool MoreMountains.TopDownEngine.FallingPlatform3D._contact = false |
|
protected |
◆ _initialPosition
| Vector3 MoreMountains.TopDownEngine.FallingPlatform3D._initialPosition |
|
protected |
◆ _newPosition
| Vector2 MoreMountains.TopDownEngine.FallingPlatform3D._newPosition |
|
protected |
◆ _platformTopY
| float MoreMountains.TopDownEngine.FallingPlatform3D._platformTopY |
|
protected |
◆ _rigidbody
| Rigidbody MoreMountains.TopDownEngine.FallingPlatform3D._rigidbody |
|
protected |
◆ _timer
| float MoreMountains.TopDownEngine.FallingPlatform3D._timer |
|
protected |
◆ InevitableFall
| bool MoreMountains.TopDownEngine.FallingPlatform3D.InevitableFall = false |
if this is true, the platform will fall inevitably once touched
◆ NonPhysicsFallSpeed
| float MoreMountains.TopDownEngine.FallingPlatform3D.NonPhysicsFallSpeed = 2f |
the speed at which the platforms falls
◆ State
the platform's current state
◆ TimeBeforeFall
| float MoreMountains.TopDownEngine.FallingPlatform3D.TimeBeforeFall = 2f |
the time (in seconds) before the fall of the platform
◆ UsePhysics
| bool MoreMountains.TopDownEngine.FallingPlatform3D.UsePhysics = true |
if this is true, the object's rigidbody will be turned non kinematic when falling. Only works in 3D.
The documentation for this class was generated from the following file:
- H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Environment/FallingPlatform3D.cs