childed object won't stay still on parent object

hey guys im trying to solve a problem here, i’m trying to get the same position as the cube when i’m on it, so i can get dragged from one point to another, i tried to make my cube child of the ball but this is happening no parent-child relation
Imgur: The magic of the Internet with
parent child relation
Imgur: The magic of the Internet

script:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;
using UnityEngine.EventSystems;

public class PlayerMovement : MonoBehaviour
{
    [SerializeField] GameObject Player;
    Rigidbody playerRigidBody;
    Vector3 movement;
    Renderer playerColor;
    [SerializeField] float speed = 10f;
    [SerializeField] float jumpForce = 5f;
    [SerializeField] bool hasJumpedOnce = false;
    [SerializeField] Joystick joystick;   
    [SerializeField] GetAudioSource audioSFX;   

    Vector3 ballPosition;


    // Start is called before the first frame update
    void Start()
    {       
        audioSFX = FindObjectOfType<GetAudioSource>();
        playerRigidBody = Player.GetComponent<Rigidbody>();
        playerColor = GetComponent<Renderer>();
        hasJumpedOnce = false;

    }

    // Update is called once per frame
    void Update()
    {
        HorizontalVerticalMovement();

    }


    public void JumpOnce()
    {
        if (hasJumpedOnce == false)
        {
            Vector3 jump = new Vector3(0, jumpForce, 0);
            playerRigidBody.AddForce(jump, ForceMode.Impulse);
            audioSFX.audioSource.PlayOneShot(audioSFX.jumpSFX, 5f);
            hasJumpedOnce = true;


        }

        else
        {
            return;
        }
    }

    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "Ground")
        {
            hasJumpedOnce = false;
        }

        else if (collision.gameObject.tag == "WhiteCube")
        {
            hasJumpedOnce = false;
        }
    }


    private void HorizontalVerticalMovement()
    {
        float verticalMovement = joystick.Vertical;
        movement = new Vector3(0, 0, verticalMovement * speed);
        playerRigidBody.AddForce(movement, ForceMode.Impulse);       

        float horizontalMovement = joystick.Horizontal;
        movement = new Vector3(horizontalMovement * speed, 0, 0);
        playerRigidBody.AddForce(movement, ForceMode.Impulse);
    }
}

It’s too hard to tell what your setup is exactly, so just some tips for physics based platforms:

  • Everything that moves should have a rigidbody, make it kinematic if it should only affect other objects, not being affected itself.
  • Avoid nesting non-kinematic rigidbodies, the physics override Unity’s transform hierarchy and it will just get confusing.
  • When animating kinematic rigidbodies, use Rigidbody.MovePosition and Rigidbody.MoveRotation instead of setting position/rotation on the transform. This will make platforms more stable.
  • Use physics materials so that you can define the friction of your objects.
  • I can’t tell if your player sphere actually rolls? This will make it harder to keep it on the platform. You might have to use a script that applies the platform’s acceleration to the sphere or lock the sphere’s rotation to prevent it from rolling off.