I have a game character object which is followed by camera. Camera is child object of Character.
Using rigid body makes the character tilt in slopes and camera tilts too.
how do i stop camera tilting when character tilts?
The answer is in your second sentence.
Camera is child object of Character.
The Camera should not be a child of the character. This is what is causing the camera to tilt. A child will follow its parent's transform.
Remove the Camera from the Character. The script @Jon linked to will do what you want by modifying the camera transform, as the character moves without modifying rotation. So, your Camera shouldn't tilt at all.
If you need the camera to be a child of your character, @Jon offers another solution in the chat he links to that updates the Camera with an inverse rotation of your character.