- Home /
Question by
just4brave · Aug 23, 2016 at 07:42 AM ·
2dinstantiatebackground
how to instantiate multiple 2d background?
I want to make 2d game in which game object is falling down and background need to instantiate vertically
Comment
Answer by Bieere · Aug 23, 2016 at 11:02 PM
Look into object pooling, to avoid lots of extra gameObjects, but pretty much the simplest way to do this is:
Instantiate(mySprite, Vector3.up * transform.position * anOffset, Quaternion.identity);
This just creates a new sprite at (0, y, 0) where y is whatever the height you need is.
anOffset value is a float.
Look here for more info: Instantiate
Your answer
Follow this Question
Related Questions
Photon Gun Pickup Not Showing On All Screens 0 Answers
Position + Vector3 doesn't return correct values 1 Answer
Tilemap With Irregular Lines 1 Answer
Issue with photon instantiate 0 Answers
2D Animation does not start 1 Answer