If you plan on having moving platforms push your playable character, you'll want to use a Pusher in addition to it Typically you'll want to parent a pusher to the platform, and bind it to the Pusher's inspector. You can see an example of it in use in the MinimalMovingPlatforms demo scene
More...
If you plan on having moving platforms push your playable character, you'll want to use a Pusher in addition to it Typically you'll want to parent a pusher to the platform, and bind it to the Pusher's inspector. You can see an example of it in use in the MinimalMovingPlatforms demo scene
◆ Awake()
virtual void MoreMountains.CorgiEngine.Pusher.Awake |
( |
| ) |
|
|
protectedvirtual |
On Awake we initialize our bounds
◆ DetachController()
virtual void MoreMountains.CorgiEngine.Pusher.DetachController |
( |
CorgiController |
controller | ) |
|
|
protectedvirtual |
Detaches a specific controller from this pusher
- Parameters
-
◆ OnTriggerEnter2D()
void MoreMountains.CorgiEngine.Pusher.OnTriggerEnter2D |
( |
Collider2D |
other | ) |
|
|
protected |
On trigger enter, we add a colliding controller to our management list if needed
- Parameters
-
◆ Update()
virtual void MoreMountains.CorgiEngine.Pusher.Update |
( |
| ) |
|
|
protectedvirtual |
On Update we detach our controllers if needed
◆ _bounds
Bounds MoreMountains.CorgiEngine.Pusher._bounds |
|
protected |
◆ _boxCollider2D
BoxCollider2D MoreMountains.CorgiEngine.Pusher._boxCollider2D |
|
protected |
◆ _controllers
◆ _wipController
◆ BoundPathMovement
the moving platform to use as a speed reference
◆ DistanceThreshold
float MoreMountains.CorgiEngine.Pusher.DistanceThreshold = 1f |
how far from the collider's bounds the character needs to move to 'detach' from its influence
The documentation for this class was generated from the following file:
- Assets/CorgiEngine/Common/Scripts/Environment/Pusher.cs