- Home /
Unlimited Blood on Floor
Hi, I'm making a top down game. I want the blood that is spilled on the floor to remain on the floor. Currently, I'm instantiating the blood sprite GameObject every time I want blood but this slows down the game.
Here is the game link I saw on youtube. The game does not slow down even when they spill thousands of blood sprites. Though I seriously doubt they are instantiating blood sprites. What do you think they are doing here.
Answer by Kennai · Jun 22, 2019 at 08:06 PM
Hello, @nareshbishtasus!
I bet they draw sprite to texture. So they have huge texture 4k x 4k, and they draw each blood to texture. No need to instantiate any game object! No matter how much blood is there.
Yeah! I realised that and now im currently using setpixel to implement this, do u know anything more efficient than this???
Thanks for replying. Thank you.
Hmm, maybe use raw data, its whole array of colors. and then modify only needed colors. But you will need somehow to "convert" texture position (x,y) to array index.