My game is lagging after a few minutes, I think it may be the clones. I want it to not lag but I’ve tried everything, help.
Bring to Front can actually cause massive lag, even for high-end devices, when multiple objects are running the block all at the same time. The best way to layer them is to use the Z-index blocks instead. Lower numbers = more in background, higher numbers = more in foreground. Unlike Bring to Front, Z-index doesn’t need to be constantly ran to work properly.
i know im being not helpful at all and not being on topic but the game is really really fun and addicting, i absolutely love it. its a really really promising game with great potentials!! keep going :)
That helped a lot but later in, shooting lags the game incredibly, any ideas on why?
This could be caused by clones cloning themselves (1 to 2 to 4 to 8 to 16 to 32… rather than 1 to 2 to 3 to 4 to 5…)
nop, i checked the number of clones and they are consistent, not exponential
That might just be your device. It doesn’t lag on mine.
I’ll test it on my phone and see what happens
it lags on mine as well - we all know your device is op, you cant say that lol
Yeah, but lag caused by Bring to Front every frame will still occur on my device. Even my device is not safe from the play sound lag (partially unrelated to this issue).
I am going to post the updated version with z axis instead, the I can continue from there, I’ll let you know when it gets approved
ik, didnt say the opposite. what i said is that if it doesnt lag on yours it doesnt mean it doesnt lag for other’s device, and that is even more true on a such powerful device like yours. you might feel the bring to front bug but might not feel the smaller lags, aka the bullet lag
Bullets still lag, but I can get to round 15 without lag constantly which is a big difference but I still can’t figure out the bullets
I love the game but I have seen that it gliches back to leavel zero sometimes. I also think it could be cool if you added a section in the shop for one time purchases such as a spam fire option, an invincibility field, and larger ammo. These could each last 10 seconds and than have a cooldown.
I really like the controls in this game, it’s great so far. It seems like what is causing most of the lag is collision testing, Hopscotch’s when bumps block gets pretty laggy with a lot of objects and in my test collision-related stuff took almost all the time.
If you are not changing the z index of any object then set z index is probably better to run repeatedly, but I’d recommend just not running it repeatedly at all. The only time you’d need to run bring to front repeatedly is when you want a clone to go under some object. The lag caused by that would probably depend on how many objects you’re bringing to front, you’d need to test to see.
Set z index does a lot whenever it is used to change an object’s z index. It only does this at most once per frame so changing the z index of 1000 objects in one frame is the same as changing the z index of only 1.
I saw a similar problem in Spy_Guy_96’s project: Perilous Parallelogram, where the frame rate dropped significantly from 60 FPS to like 15 FPS upon playing it, even on my most powerful device, and Bring to Front (which was ran every frame by pretty much every object) was the main cause of lag.
I personally never use Bring to Front.
Yeah, running bring to front every frame by every object would most likely be laggier than even changing z index every frame.
Oh so thats why its so laggy