Add a dynamic one way platform
Last updated
Last updated
The process is very similar as the one for static one way platforms. However, there are a few important things to consider:
(follow these instructions).
Add a Rigidbody (Rigidbody2D) component to the platform. One way platforms should be kinematic, make sure to enable the isKinematic property.
This component is responsible for re-simulating the platform physics and detecting multiple characters (using a BoxCast). It will automatically detect the BoxCollider component (whether is 2D or 3D) and Rigidbody component (whether is 2D or 3D).
The component itself exposes a layer mask that should be used to filter the collision results. Make sure to specify all the layers with characters on them (or leave it like that, "Everything" is set by default).
Here's an example of a dynamic 3D one way platform (with no movement behaviour).
Once you have everything set up, it is time to add the movement behaviour. You can choose whatever method you want, using a custom script, using CCP's platform behaviours (e.g. ActionBasedPlatform), etc.