Question by
CodeBoyIsOnline · Jun 14, 2020 at 06:36 PM ·
gameobjectspritebeginner
Question on gameobject iteration transformation
Hey. I've got the following code written, but when I add in the commented code, none of the sprites actually show themselves, but when it's commented out all sprites remain on the scene which I don't want either. Any help would be great!
void Update() { if(script.scenes.Count > 0) { foreach (Character actor in script.scenes[0].charactersIncluded) { GameObject characterObject = actor.createCharacter(); characterObject.transform.position = new Vector2(staticRandom.Instance.Next(-10, 10), staticRandom.Instance.Next(-4, 4)); Debug.Log(actor.firstName); Thread.Sleep(100); //Destroy(characterObject); } script.scenes.RemoveAt(0); } }
Comment
Your answer
Follow this Question
Related Questions
What easier to instantiate: game object or RigidBody 0 Answers
Object reference not set to instance of an object? 1 Answer
Unity 2D Animation Sprite positioning help 0 Answers
All collectibles before next scene? 0 Answers
Tag control 0 Answers