How do I make objects appear when on screen?

  • Hello everyone. So I'm doing some performance fixes, and would like to make objects dissapear when not in the view, but appear when on screen. I cannot find any solutions, so if anyone could help? Tnx!

  • What do you mean by "disappear"? Become invisible? This will give you zero performance improvement, because it doesn't matter if off-screen objects are visible or not, they are not rendered.

  • Hello. No, no, I mean, that they get destroyed, so they are not in the layout, and they spawn just before they get on screen. Is it possible?

  • Destroying part is easy - just add "Destroy outside of layout" behavior to these objects.

    You'll have to create some events to spawn them when you want them to appear on the screen.

  • Yes, that's the problem. I can't figure out how to make them appear on screen again. I tried with spawn another object, but didn't work..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't understand your problem, really.

    After objects are destroyed, they are gone, forget about them.

    It's entirely up to you how you spawn new objects. You can create them at random intervals or when some event happens in your game.

    Make sure you create new objects inside the layout, or they will get immediately destroyed.

  • So there is no such things as LOD's in Construct? In order to save memory, they appear in the scene only when they are on the certain distance from the player. For example, they spawn only when on screen, and they are not in layout when off screen? I work as a level designer for 3D games and this is normal thing to do, but can't find a way to do it here.

  • Objects are not rendered when off-screen. If they are not part of CPU-demanding events and don't have "heavy" behaviors (like Physics) enabled, then they should be using very little resources. You don't need to delete them.

    You can exclude off-screen objects from events using "Is on-screen" and "Is outside layout" conditions.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)