Jump to content

Trouble with creating instances in HTML5


Theaset
 Share

Recommended Posts

For some reason the instance_create_layer() and instance_create_depth() functions do not seem to work at all for me on HTML5. They work fine when testing on OS. It does not seem to matter whether I call the layer by name like this: instance_create_layer(x,y,"Player",Object); or with built in variables like this: instance_create_layer(x,y,layer,Object). But both ways work on OS. I checked the debug console on the browser and the error I get is this:

"Error: Trying to create an instance on a non-existant layer."

I don't understand why that error is happening, since I am naming layers I know already exist, or I am calling the layer ID directly with the "layer" built-in variable. And since the exact same code works on other platforms...

There is also a Source Mapping error warning, that could be related, but I don't know:

Source map error: request failed with status 404

I really need this functionality for my game, so if anyone has any insight into why these functions are not working on HTML5, and what I can do to fix it, I would really appreciate it. (I am using GameMaker Studio 2.2, in case that matters.)

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...