Z-Index Causes Lag

Use this template to make awesome bug reports:

Your username: GravyStudiosNExT

What kind of device are you using?: iPad Mini 1

1 sentence description of the problem I was working on my project, and set a high z-index, and then the project lagged to the point that it crashed.

Steps that the Hopscotch team can take to reproduce my problem every time:

  1. Create a project with two objects.
  2. Set one’s z-indez to a very large number, such as 1000000. Also add some code so it is possible to see lag.
  3. Hit play.
    ….

I expected this to happen:
The project to run smoothly.
But instead this happened:
The project crashed. (White screen)
Here’s a sweet screenshot:
I don’t have a screenshot.

8 Likes

I made a project with 2 objects and 1 setting to a z index of 55050404664464614944 and fps was 62

5 Likes

Maybe it’s just an issue with old devices.
If I make a project with nothing except an fps detector I rarely get 60 fps, and with a high z index, I will only get 20-30.

5 Likes

Usually it’s around 60-61 (FPS) for me. I also think the bug might be because of old device.

5 Likes

That’s probably the most likely explaination cuz it lags on my iPad a lot too

7 Likes

Yep, HS seems to create a layer for every number until it reaches the highest number in the project.

So Z 10000 will create all 10000 layers, even if it’s the only Z Index, as opposed to something like 1 or 100.

6 Likes

One thing I don’t understand.

Why do you need to set an object to z-index 1000000?

4 Likes

If you want to make sure it’s always in the front.
Especially if you have 1000000 objects. (OK that part is far-fetched)

5 Likes

While game is playing - bring to front

5 Likes

That is literally what I do in my projects (every single text and object under the color picker of 2-in-1 Drawing Pad).

I use When 7 = 7.

3 Likes

The object limit is 4096, including clones, so maybe set it to 4096 instead.

3 Likes

Cuz u old school like me.my new projects all contain 7 = 7 lol

4 Likes