How to make camera stop.,How to make the camera stop ???

,Hi,
I am a beginner in C sharp.
I just compiled this code and I don’t know how to make the camera stop.
Please help.

using UnityEngine;

public class PlayerMovement : MonoBehaviour {
public Rigidbody rigidBody;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void FixedUpdate () {
		if ( Input.GetKey("w"))
		{
GetComponent().AddForce(0,0,500 * Time.deltaTime);
		}
		if ( Input.GetKey("d"))
		{
GetComponent().AddForce(500 * Time.deltaTime,0,0);
	}
}
}

Umm, the class name is PlayerMovement, how are you moving the camera from that? Also what are you getting with GetComponent?

You would have to do something like:

if (Input.GetKeyUp("W") || Input.GetKeyUp("D")) {
    GetComponent<Rigidbody>().velocity = Vector3.zero;
}

and if you need to stop rotation add this:

GetComponent<Rigidbody>().angularVelocity = Vector3.zero;

But I would suggest setting a reference to the rigid body in start instead of using GetComponent in a loop like Update. It use ressources with each calls.