AddForce makes cube

Okay - so I have got a problem with addForce. At the moment my character is a cube which is moving around in a 3-dimensional space. However when it is on the floor it starts to roll instead of slide. I tried to deactivate gravity and let it float in the air above the course and here the sliding works perfectly fine. Now I deactivate gravity when it is on the ground, and now it only rolls over occasionally.

transform.rigidbody.AddRelativeForce(Vector3.forward * moveSpeed);

This is the code used to move my character.

Can someone help me solve this?

relative force is used to move the object in local space whereas vector3 tries to move in world space.You may try using transform as below.

transform.rigidbody.AddForce(transform.forward * moveSpeed);

Let me know if this resolved the issue.

Go onto your rigid body and remove rotation from there, you can also add friction on your cube collider.

Im doing the exact same thing now and this works for me^^