Stick Player On Moving Platform

Hello to everyone.I have a problem on my 2D game.I made a moving platform but when the player is on the platform slips and i want to move player and platform together.I know that is a common question.I try several things that i found on internet but with no result.Please help me.

my player has a rigidbody, box and circle collider and
my moving platform has 2 box collider and platform effector 2D.

My player script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour {

	public float maxSpeed;
	public Vector3 respawnPoint;

	bool grounded = false;
	float groundCheckRadius = 0.2f;
	public LayerMask groundLayer;
	public Transform groundCheck;
	public float jumpHeight;

	Rigidbody2D myRB;
	Animator myAnim;
	bool facingRight;

	public Transform gunTip;
	public GameObject bullet;
	float fireRate = 0.5f;
	float nextFire = 0f;

	// Use this for initialization
	void Start () {
		myRB = GetComponent<Rigidbody2D> ();
		myAnim = GetComponent<Animator> ();
		respawnPoint = transform.position;

		facingRight = true;

	}
	
	// Update is called once per frame

	void Update(){
		if (grounded && Input.GetAxis ("Jump") > 0) {
			grounded = false;
			myAnim.SetBool ("isGrounded", grounded);
			myRB.AddForce (new Vector2 (0, jumpHeight));
		}

		if (Input.GetAxisRaw ("Fire1") > 0) fireRocket ();

	}



	void FixedUpdate () {

		grounded = Physics2D.OverlapCircle (groundCheck.position, groundCheckRadius, groundLayer);
		myAnim.SetBool ("isGrounded", grounded);
		myAnim.SetFloat ("VerticalSpeed", myRB.velocity.y);

		float move = Input.GetAxis ("Horizontal");
		myAnim.SetFloat ("speed", Mathf.Abs (move));
		myRB.velocity = new Vector2 (move * maxSpeed, myRB.velocity.y);

		if (move > 0 && !facingRight) {
			flip ();
		} else if (move < 0 &&facingRight) {
			flip ();
	 }
}
	void flip(){
		facingRight = !facingRight;
	    Vector3 theScale = transform.localScale;
		theScale.x *=-1;
		transform.localScale = theScale;  
	}

	void fireRocket(){
		if (Time.time > nextFire) {
			nextFire = Time.time + fireRate;
			if (facingRight) {
				Instantiate (bullet, gunTip.position, Quaternion.Euler (new Vector3 (0, 0, 0)));
			} else if (!facingRight) {
				Instantiate (bullet, gunTip.position, Quaternion.Euler (new Vector3 (0, 0, 180f)));
			}
		}
	}

	void OnTriggerEnter2D(Collider2D other){
		if (other.tag == "cleaner") {
			transform.position = respawnPoint;
		}
		if (other.tag == "Checkpoint") {
			respawnPoint = other.transform.position;
		}

		}
	}	

My moving platform script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MovingPlatform : MonoBehaviour {


	public float moveSpeed;

	public Transform currentPoint;

	public Transform[] points;

	public int pointSelection;

	public bool goup = false;

	// private Animator anim;

	// public bool spin = false;

	void Start ()
	{
		currentPoint = points[pointSelection];
		//anim = gameObject.GetComponent<Animator>();
	}

	void OnTriggerEnter2D (Collider2D col)
	{
	    if(col.tag=="Player")
		goup = true;
	}
	void OnTriggerStay2D(Collider2D col)
	{
		if(col.tag=="Player")
		goup = true;
		// anim.SetBool("Spin", spin=true);
	}

	void OnTriggerExit2D (Collider2D col)
	{
		if(col.tag=="Player")
		goup = false;
		// anim.SetBool("Spin", spin = false);
	}

	void FixedUpdate()
	{
		if (goup == true)
		{
			
			currentPoint = points[1];
			transform.position = Vector3.MoveTowards(transform.position, currentPoint.position, Time.deltaTime * moveSpeed);

	        if (transform.position == currentPoint.position)
			{
				pointSelection++;

				if (pointSelection == points.Length)
				{
					pointSelection = 0;
				}
				currentPoint = points[pointSelection];
				//anim.SetBool("Spin", spin = false);
			}
		}
		else if (goup == false)
		{
			currentPoint = points[0];
			transform.position = Vector3.MoveTowards(transform.position, currentPoint.position, Time.deltaTime * moveSpeed);
		}
	} 
}

Please help me i don’t know what to do.

Try This VVVVVV - This requires only a single collider on the gameobject with the script… If you can’t do that, then make the list (see below) a public list and put the “OnCollisionStay” onto a new script (which goes onto the other collider) and change it so it just references the first script (with the GameObject list)… Also, this will also require it to be just a collider and not a trigger… (otherwise just change it to OnTriggerStay (collider c))

Add a list to the variables on the top of the script

List<GameObject> AttachedObjects = new List<GameObject>();

Next, Add this void so that every update each object on the moving object will add itself to the list if the collision points are above the platform

void OnCollisionStay(Collision c) {
     bool IsOnTop = false; 
     // Set "IsOnTop" to true if you want objects connected to sides and bottom to move too
     // Note that setting IsOnTop to true may cause any walls or ledges that the collider runs into to Move too

     foreach (ContactPoint item in c.contacts) {
          IsOnTop = item.point.y > transform.position.y || IsOnTop;
     }
     if (IsOnTop) {
           bool Unique = true;
           foreach (GameObject item in AttachedObjects) {
                Unique = item == c.gameobject || Unique;
           }
           if (Unique) {
                AttachedObjects.Add(c.gameobject);
           }
     }
}

Finally, Add this directly after your transform.position = Vector3.MoveTowards(transform.position, currentPoint.position, Time.deltaTime * moveSpeed); (but still in the else statement)

foreach (GameObject item in AttachedObjects) {
     item.transform.position = Vector3.MoveTowards(transform.position,currentPoint.position, Time.deltaTime * moveSpeed);
}
AttachedObjects.Clear()

This way every frame that an object is ontop of the platform, it adds itself to the list. Whenever the platform moves, it moves all objects currently on the platform the same direction, and clears the list (so it can be refilled the next update)