Hi All,
Again I have a questions for something which I’m sure is going to be a relatively easy answer but for some reason I’m struggling to find the answer for it. Basically what I’m looking at doing is referencing an object created using the Instantiate command.
So an example would be (though this doesn’t work):-
GameObject newGroundTile = Instantiate( GameObject.Find( "GroundTile" ), new Vector3( 5f, 0, 5f ), Quaternion.identity );
newGroundTile.transform.position = new Vector3( 0, 0, 0 );
Now in this situation I’m aware that I can just set the position when creating it, but this is just an example to show what I’m trying to do. I may want to do some additional effects / rotations / what ever on it once it’s created depending on other factors. When trying to do whats above I get
I try changing over to the type over to Object rather than game object and I no longer get the error, but I can’t reference any of the objects properties to actually change it. (eg newGroundTile.transform.position). Now I’m not sure if I should be using this to reference the object somehow, or if I should be finding the reference to the object another way all together… If anyone is able to point me into the right directions it would be appreciated!
Stevil