Moveable Platforms - 2D Platform

I am working on a 2D game which involves a movable platform. But, whenever I jump on the moveable platform my character doesn't move with it. How do I fix this?

This questions has come up lots of times before. See here: http://answers.unity3d.com/questions/694/charactercontroller-falls-through-or-slips-off-moving-platforms

you could use code to make the player bocme a child of the platform.

var player : Transform;
var target : Transform;

function Update()
{
 if(Input.GetKeyUp("q"))
 {
  player.parent = target.transform;
 }
 else if(Input.GetKeyUp("e"))
 {
  player.parent = null;
 }
}

this is a javascript to make the player move with the platform when you press q. and make the player move without the platform when you press e.

you make the platform you want the "target" and the "player" you make the player.

well... unity3_user kinda had it. but if you just hit q in the middle of the game your character would be parented to the moving platform.

here is a better version of that script. all you have to do is tag the first moving platform "MovingPlatform1" and make sure that target is the moving platform and player is your character.

var player : Transform;
var target : Transform;
function OnControllerColliderHit(hit:ControllerColliderHit)
{
if(hit.gameObject.tag == "MovingPlatform1")
{
player.parent = target;
}
}
function Update()
{
if(Input.GetButtonDown("Jump"))//assuming that spacebar is your jump key
{
player.parent = null;
}
}

You might have to make the Character have a rigid body, or add a magenetism to the platform, and also a force to the characters jump so he can evade the magenetism by jumping.

Your best bet would to be taking a look at the moving platforms in the 2D Gameplay Tutorial. It has movable platforms that go vertically and, with a small adjustment in the editor, horizontally.

You could add a trigger collider on the platform so OnTriggerEnter you find the speed of platform and apply it to the character until the player gets off the platform.

Use this only if easier ways fail.