Unable to Parent to a canvas

Im simply trying to parent a prefab to a canvas, there no problem instantiating the object only when i parent via “SETPARENT” it breaks the scene; when i drag it in runtime to the canvas theres also no problem. Any ideas?

(The script is in the canvas object, the canvas is drag and set in the editor, i also try using gameobject but still wont work).

public static bool fightSwitch;
	public GameObject party;
	public Canvas canvas;

	// Use this for initialization
	void Start () {

		fightSwitch = false;
	}
	
	// Update is called once per frame
	void Update () {

		if (fightSwitch == true) {
			GetComponentInChildren<Animator>().SetBool("Intro", true);
			fightSwitch = false;

			party = Resources.Load ("OBJECTS/PARTY") as GameObject;
			Instantiate (party, transform.position, transform.rotation);

			party.transform.SetParent (canvas.transform,false);

You are trying to parent the party prefab directly under canvas and not the instance of party prefab you have created. What you need is:

party = Resources.Load ("OBJECTS/PARTY") as GameObject;
GameObject partyInstance = Instantiate (party, transform.position, transform.rotation);
// We set canvas to be child of instance and not the party prefab from resources.
partyInstance.transform.SetParent (canvas.transform,false);