How to parent a prefab?

Im making a laser beam follow my ship after firing it by making the ship its parent. However I’m getting error:
“Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.”

My code:
`var blah : Transform;

function Start () {
transform.parent = blah;
}`

The beam instantiates from ship prefab.

Thanks in advance.

You are trying to assign the prefab itself, and not the object instantiated from it. Look here, this question is similar to yours, and it should help:

Once you instantiate the prefab then only you can assign the parent for that prefab. Making parent to prefab at runtime is not possible.