Can i make istrigger true just for spesific object ?

I want to make istrigger is true just for my ball, so my ball can go through line and my player can not pass it, it is like net in tennis.
This is the screenshot

Hey there!
Are you looking for something like this:

GameObject.Find ("Ball").GetComponent<Collider> ().isTrigger = true;