Hi, i’m making a side-scroll game and i have a problem , i made a moving cube that moves up and down, but the problem is that my player not standing on that cube while it going down cuz its faster then the gravity force, and while the cube is going up the player can’t even stand on it cuz it actually avoiding the player… i don’t know what to do…
this is the script i used for the cube
void ProcessState()
{
if (transform.position.y >= -43)
{
Down = true;
Up = false;
}
if (transform.position.y <= -130)
{
Down = false;
Up = true;
}
}
void Move()
{
if (Down)
{
transform.position += Vector3.down * Time.deltaTime * moveSpeed;
}
if (Up)
{
transform.position += Vector3.up * Time.deltaTime * moveSpeed;
}
}