why we used hideinspector ???

i m the begner so tell me in detail.

You use [HideInInspector] above variables which are public that you don’t want visible in the inspector in unity. This might be because you want to have a public variable accessible from another script, but not that the user can edit in the inspector and assign to the wrong thing…