How create a object on a empy layer?

From the Asset Store
112 High-Quality destruction sounds for videogames
  • Hello! I need help!<img src="smileys/smiley19.gif" border="0" align="middle" />

    Please some brother can helpme?

    Im trying to create a objet into a empy layer by code

    On star layout > system create object (select objet, layer and x & y)

    But give me a error

    I have 8 sprites and i want to create one without draw onto layer by mouse.

    Thank you

  • Moved to 'How do I?'

    What error do you get?

  • 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@http://localhost:50000/preview_prelude.js:12

    ://localhost:50000/preview.js:1457

    ://localhost:50000/preview.js:1448

    ://localhost:50000/preview.js:1445

    ://localhost:50000/system.js:552

    ://localhost:50000/eveng.js:996

    ://localhost:50000/eveng.js:502

    ://localhost:50000/eveng.js:477

    ://localhost:50000/eveng.js:1971

    ://localhost:50000/eveng.js:1858

    ://localhost:50000/eveng.js:1827

    ://localhost:50000/preview.js:999

    ://localhost:50000/preview.js:892

    ://localhost:50000/preview.js:949

    Thanks!

  • No default instance when creating object. You must have at least one instance of every object type in at least one layout.

    The error message says it all.

    You must create at least one instance (during edittime) for all your object types in one of the layout of your project.

    Even if you place the instance outside of the layout and/or destroy it on start of the layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > No default instance when creating object. You must have at least one instance of every object type in at least one layout.

    The error message says it all.

    You must create at least one instance (during edittime) for all your object types in one of the layout of your project.

    Even if you place the instance outside of the layout and/or destroy it on start of the layout.

    Thank you so much for reply, but yet i don?t understand. create a instance is take the mouse and draw a sprite into a layout? In that case i have a problem, becouse i have heavy sprites (are character for fighting game) in diferents colours. I must draw everything in a layout? thank you <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Any sprite in your project needs at least one instance in one of the project's layouts.

  • Ok thank you very much Kyatric!

  • Yes you "draw" every sprite you're gonna use in a specific layout, this is by design.

    In my opinion this is a design flaw, if the object is in your project you should be able to create it whether or not one already exists. But since I don't know the inner workings of C2 I have no idea of how feasible it is, and I trust Ashley.

    Best thing you can do is either create a layer or a family with all the object you had to create, and then use on start of layout -> destroy for every object in the family or layer.

    Ninjaed by Kyatric, you sneaky devil

  • Yes you "draw" every sprite you're gonna use in a specific layout, this is by design.

    In my opinion this is a design flaw, if the object is in your project you should be able to create it whether or not one already exists. But since I don't know the inner workings of C2 I have no idea of how feasible it is, and I trust Ashley.

    Best thing you can do is either create a layer or a family with all the object you had to create, and then use on start of layout -> destroy for every object in the family or layer.

    Ninjaed by Kyatric, you sneaky devil

    Thank you for the info bro! I?ll try to destroy sprites for save memory ram, but i think best way is a small update in the engine. :)

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