# Player slips off moving platform

**URL:** https://discussions.unity.com/t/player-slips-off-moving-platform/91932
**Category:** Questions & Answers
**Created:** [January 7, 2014, 5:48pm UTC](https://discussions.unity.com/t/player-slips-off-moving-platform/91932 "2014-01-07T17:48:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![misko96](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@misko96](https://discussions.unity.com/u/misko96)
#### Post date: [January 7, 2014, 5:48pm UTC](https://discussions.unity.com/t/player-slips-off-moving-platform/91932/1 "2014-01-07T17:48:52Z")

</div>

Hi,  
so i have Player in 3D game and i made platform that moves in X axis with this script:  
var Speed : float = 2;  
var NewPos : Vector3;  
private var StartPos : Vector3;  
private var GTime : float;  
private var IsThere : boolean;

```
    function Start () {
    StartPos = transform.position;
    }
     
    function Update () {
    if (GTime <= 1 && !IsThere) { GTime += Speed * Time.deltaTime; }
    if (GTime >= 1) { IsThere = true; }
    if (GTime >= 0 && IsThere) { GTime -= Speed * Time.deltaTime; }
    if (GTime <= 0) { IsThere = false; }
     
    transform.position.x = Mathf.Lerp (StartPos.x,NewPos.x,GTime);
    transform.position.y = Mathf.Lerp (StartPos.y,NewPos.y,GTime);
    transform.position.z = Mathf.Lerp (StartPos.z,NewPos.z,GTime);
    }

```

but my player dont follow it when he is on it,how do i fix it?

---

<div class="post-metadata">

### Author: ![MakinStuffLookGood](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/makinstufflookgood/32/44237_2.png) [@MakinStuffLookGood](https://discussions.unity.com/u/MakinStuffLookGood)
#### Post date: [January 7, 2014, 6:13pm UTC](https://discussions.unity.com/t/player-slips-off-moving-platform/91932/2 "2014-01-07T18:13:45Z")

</div>

Two options:

- Parent the player to the platform when they are grounded on it and unparent them when they are grounded on a new platform or simply when they jump

- Use physics. If you’re using the built in rigidbody physics, keeping one body on a moving platform is a matter of playing with friction on the physic material

You could also maybe try a more programmatic solution where you don’t change the transform parent, but just also apply the movement of the platform to the player while they’re standing on the platform.
