Error: "No default instance when creating object"

0 favourites
  • 7 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • Hi

    I'g getting error when I tried use z as shot.

    Assertion failure: No default instance when creating object. You must have at least one instance of every object type in at least one layout. This will be fixed in a future build...

    Stack trace:

    assert2(null,"No default instance when creating object. You must have at least one instance of every object type in at least one layout. This will be fixed in a future build...")@http://localhost:50000/preview_prelude.js:12

    (null,[object Object],false,972,6870)@http://localhost:50000/preview.js:865

    ([object Object],[object Object],972,6870)@http://localhost:50000/preview.js:858

    ([object Object],[object Object],3)@http://localhost:50000/Sprite_plugin.js:962

    ()@http://localhost:50000/eveng.js:711

    ()@http://localhost:50000/eveng.js:312

    ()@http://localhost:50000/eveng.js:301

    ((function (key) {"use strict";var ret = key === this.triggerKey;this.eventRan = this.eventRan || ret;return ret;}),[object Object],[object Object])@http://localhost:50000/eveng.js:1518

    ((function (key) {"use strict";var ret = key === this.triggerKey;this.eventRan = this.eventRan || ret;return ret;}),[object Object])@http://localhost:50000/eveng.js:1403

    ([object Object])@http://localhost:50000/Keyboard_plugin.js:85

    ([object Object])@http://localhost:50000/Keyboard_plugin.js:52

    ([object Object])@http://localhost:50000/jquery-1.6.3.min.js:3

    ([object KeyboardEvent])@http://localhost:50000/jquery-1.6.3.min.js:2

  • The error is pretty much right, we aim to fix this soon but in the mean time just make sure there's an instance of the object you're trying to create already placed in the layout.

  • Any update on this one? It's relatively easy to work-around, but I'm finding myself having to work around it a LOT... obviously not something that deserves high priority, but it would be nice to have fixed. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • This is actually something that is really anoying if you have a bigger project, its something i would really love to see fixed in next build.

  • Is it that annoying? You just need one unused layout in the project where you dump a single instance of every object in your game, then you never need to worry about this.

    It's kind of a quirk of the engine because if you create an object and there are no instances anywhere in the project, C2 doesn't know what to use for the object properties. It's one of the things on the todo list for a long time but I thought it was minor and it's a little tricky to fix.

  • Aha -- I hadn't actually thought to work-around by sticking default instances in a default layout rather than hiding them or putting them off screen. Still a bit of a kludge, but a much nicer fix, thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It should e fairly easy to come up with sensible defaults should't it? The only difficult ones should e position related, and those are supplied during creation.

    It is a fairly minor annoyance though -- keep up the great work with other new features, love your work!

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