Sign in to follow this  
Theaset

Trouble with creating instances in HTML5

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.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.