unity instantiate set parent code example

Example 1: instantiate unity in parent

var myNewSmoke = Instantiate (poisonSmoke, Vector3(transform.position.x,transform.position.y, transform.position.z) , Quaternion.identity);
  myNewSmoke.transform.parent = gameObject.transform;

Example 2: unity instantiate as child

//SetParent() method
//https://docs.unity3d.com/ScriptReference/Transform.SetParent.html
//or something like this 
 var myNewSmoke = Instantiate (poisonSmoke, Vector3(transform.position.x,transform.position.y, transform.position.z) , Quaternion.identity);
   myNewSmoke.transform.parent = gameObject.transform;