1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

HTML5 Intance_create not working

Discussion in 'Programming' started by splendidtank, May 28, 2019.

  1. splendidtank

    splendidtank Member

    Joined:
    Feb 19, 2017
    Posts:
    9
    The instance_create_layer function is not working my code is:
    Code:
    if (instance_exists(oPlayer)) && (point_in_circle(oPlayer.x,oPlayer.y,x,y,64))
    {   
        nearby = true;
        if (keyboard_check_pressed(ord("Q"))) && (!instance_exists(oGunPickup)) && (!instance_exists(oGun))
        {
            image_index = 1;
            show_debug_message("wow");
            instance_create_layer(x+2,y-2,"gun",oGunPickup)
        }
    }else nearby = false;
    In the HTML build no oGunPickup is spawning. Works fine in the Windows build...
     
  2. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,336
    Does "wow" appear in the console when running the game and pressing Q?
    Have you checked the browser developer console for any more in depth error messages?
     
  3. splendidtank

    splendidtank Member

    Joined:
    Feb 19, 2017
    Posts:
    9
    i got "Error: Trying to create an instance on a non-existant layer" i double checked it and "gun" is a layer... ive tried to change layer many times now... Even if i try to use instance_create_depth i get the same error... I also got this:
    Code:
    Source map error: request failed with status 404
    Resource URL: http://127.0.0.1:51264/SkogTheGame/Skog%20the%20game.js?ZHABC=1291562026
    Source Map URL: inflate.min.js.map
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice