For example, the characters jump to the reciprocating movement of the platform should follow the platform movement.
To achieve this effect there are two ideas, one is to use kinematics one is to use dynamics.
First, the kinematic idea:
1, create a box as a mobile platform, using Unity's built-in animation curves to adjust the animation of the left and right reciprocating motion.
2, add rigidbody for mobile platform and Tick is kinematic. Thus, the moving platform itself is no longer subject to kinetic action, but it can have a kinetic effect on other objects. (While the rigidbody is marked iskinematic, it'll not being affected by collisions, forces, or any other part of ph Ysx. This means, you'll have the-control the object by manipulating the Transform component directly. Kinematic rigidbodies would affect other objects, but they themselves would is not being affected by physics. Citation: http://docs.unity3d.com/Manual/class-Rigidbody.html)
3, add a script for the mobile platform to achieve the following logic: If the player is on the platform (the player's foot touch the platform and the player is in a non-hop state), the player. RIGIDBODY.VELOCITY.XZ and platform Velocity.xz consistent, otherwise make player.rigidbody.velocity.xz= (0,0). Note: (1) One might ask if you let the player. Rigidbody.velocity.xz= (0,0), how can the player move under keyboard control? Because the player in my demo is moved under keyboard control by setting the player directly. Rigidbody.position is implemented, so player.rigidbody.velocity.xz= (0,0) does not affect the character movement. (2) Why is the player. Rigidbody.velocity.xz= (0,0), not the player. Rigidbody.velocity.xzy= (0,0,0)? Because the motion in the y Direction in my demo (Free Fall) is not set directly by the player. RIGIDBODY.POSITION.Y implemented by: D.
4, this is almost done, the only problem is to find that the people jump on the platform after the game has become less smooth (slightly lag), and can be seen not caused by performance problems. Later I tried to set the Animator of the platform as follows: Animator->update mode changed from normal to animate Physics, and the lag does not occur (for reasons not yet detailed analysis, you may need to learn more about animate Physics option) to achieve the desired effect.
Second, kinetic thinking (not yet tried):
In the real world, people jump on the mobile platform with the movement of the jumping platform, is due to friction, so you can try to adjust the platform and character foot friction between the properties to achieve, to add modified friction properties, you need to change the collider in the material of the physic Material (Create method: Right mouse button in asserts window->create->physic material).
Unity, people interacting with mobile platforms