Player (Cube) goes through collisions

I have a movement script but the object goes through other objects, it doesn’t enable collisions and gravity.

var speed = 5.0f;

    function Update()
    {
    var movement = Vector3.zero;
    if(networkView.isMine) {
     
    if (Input.GetKey("w"))
    movement.z++;
    if (Input.GetKey("s"))
    movement.z--;
    if (Input.GetKey("a"))
    movement.x--;
    if (Input.GetKey("d"))
    movement.x++;
    
    transform.Translate(movement * speed * Time.deltaTime, Space.Self);
    }
    }

Can anyone help me please? Thanks in advance! :slight_smile:

Did you attach a rigid body and a collider?

Thanks alot, fire7side! Rigid body Component was missing, thank you. :slight_smile: