Hello,
I need kind of help…
Here I’m trying to make a function that will return instantiated object, and put it into variable.
here is the code sample;
public CLine CreateLine(Vector3 LinePos, CLine LinePrefab)
{
CLine NewLineScript;
NewLineScript = Instantiate(LinePrefab, LinePos, Quaternion.identity) as CLine;
Return (NewLineScript);
}
CLine LineScript;
LineScript = CreateLine(LinePos,LinePrefab);
The question is ,
Does the function returns instantiated object or the pointer to him?