Hi there,
_Graham, please don't add the error code as a tag again. It didn't help the first time or the second time. I need some actual help with this._
I'm trying to clone a UI.Text with instantiate, but it places it outside of the canvas.
I tried to use .SetParent to parent it to the canvas, but that didn't work.
This is the error I keep getting:
BCE0023: No appropriate version of 'UnityEngine.Transform.SetParent' for the argument list '(System.Type, boolean)' was found.*
And this is my script:
#pragma strict
var NotificationText : Transform;
function Update(){
if (Input.GetKeyDown("e")){
var NotificationTextClone = Instantiate(NotificationText);
NotificationTextClone.transform.SetParent(Canvas,false);
Destroy(NotificationTextClone.gameObject, 5);
}
}
↧