how to set a tag to the gameboject which created by VectorLine(using Vectorsity 1.4.2) before adding it into Hierarchy.
I presume you used the Instantiate function to spawn the object?
if so then your code should look like this:
JS
var prefab: GameObject;
function SpawnObject()
{
var obj = Instantiate(prefab, transform.position, Quaternion.identity);
obj.gameObject.tag = "MainCamera";
}
C#
public GameObject prefab;
void SpawnObject()
{
GameObject obj = (GameObject) Instantiate(prefab, transform.position, Quaternion.identity);
obj.tag = "MainCamera";
}
And if you want to change the tag before spawning it you should change the prefab tag.
prefab.tag = "MainCamera";
Also make sure to assign the prefab in the inspector.
You can use vectorObject.
vectorline.vectorObject.gameObject.tag = "theTag";