question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Existing entities blinking/disappearing on adding new entity

See original GitHub issue

I have the following scene I am using within my game. It’s a simple Tiled Map with a single button ‘UI’. I start the scene with some entities and have my update method spawn new entities on click. The spawned entities on initialization are placed on the tiled map properly but when added by mouse click, the existing and new entities just blink after each click. The debug borders around the entities are still visible but the sprites of the entities blink. Is this a bug?

public class GameScene : Scene
{
        public override void initialize()
        {
            // Set scene background color
            clearColor = Color.Black;

            Core.debugRenderEnabled = true;

            // Set camera zoom
            camera.setZoom(1);

            // Add the renderers
            addRenderer(new ScreenSpaceRenderer(100, UI.UI_RENDER_LAYER));
            addRenderer(new RenderLayerExcludeRenderer(0, UI.UI_RENDER_LAYER));

            var map = content.Load<TiledMap>("maps/Fardia");
            addEntity(new UI());
            addEntity(new Map(map));
            addEntity(new God());

            for (int i = 0; i < 100; i++)
            {
                var position = Nez.Random.range(new Vector2(10, 10), new Vector2(100, 100));

                addEntity(new Human()
                {
                    position = position
                });
            }
        }

        public override void update()
        {
            base.update();

            if (Input.leftMouseButtonPressed)
            {
                addEntity(new Human()
                {
                    position = camera.mouseToWorldPoint().round()
                });
            }
        }
    }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fabianPascommented, Aug 7, 2018

It was all me then… @SolarOmni thanks for your great example!

0reactions
prime31commented, Dec 8, 2018

Closing out all old Nez bugs without recent activity. If you are still seeing any issues feel free to open a new bug and include a full repro project that clearly shows the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

document.createElement flashes up with what I want. Then ...
Then it is disappearing. Just the message, not the entire thing, but that sometimes happens as well. What has happened and how can...
Read more >
Components of animation flicker and disappear/reappear
The objects appearing and disappearing is a problem with the clipping distance of the camera. Select the camera and make the clipping start ......
Read more >
Custom Secondary Info for Entities Card
The flicker is the result of an update - during the update process, it starts by rendering the 'standard' entity row, which does...
Read more >
Flickering props, invisible vehicles and disappearing trees
I have tested on a new map and there is no flickering props or disappearing trees. I have tested an old save of...
Read more >
Mouse cursor flickering and disappearing
I had the same problem. You can fix it manually. Open System Settings > Displays. In the Displays window, you will see an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found