public static InfoText SpawnInfoText(Transform parent, string text, Vector2 offset = default(Vector2), InfoTextType type = InfoTextType.Plain) { InfoText inst = Instantiate(infoText, parent.position, Quaternion.identity).GetComponent <InfoText>(); inst.text = text; inst.addedOffset = offset; inst.type = type; inst.SetParent(parent); //cannot simply pass in parent to Instantiate, as it would follow the rotation as well return(inst); }