jj_Weapon (Construct 3 Behaviours)

You're viewing a single comment in a conversation. View all the comments
  • 2 Comments

  • Order by
  • I can't get it to work, I get the following error

    Uncaught (in promise) ReferenceError: window is not defined

    at new jj_WeaponInstance (c8601d8d-2afd-4b36-8f7d-b160d165174b:78)

    at Function.C3.New (jsutil.js:1)

    at C3.BehaviorInstance._CreateSdkInstance (behaviorInstance.js:1)

    at C3.Instance._CreateSdkInstance (instance.js:1)

    at C3.Runtime.CreateInstanceFromData (runtime.js:1)

    at C3.Layer.CreateInitialInstances (layer.js:1)

    at C3.Layout._CreateInitialInstances (layout.js:1)

    at C3.Layout._StartRunning (layout.js:1)

    at C3.Runtime.Start (runtime.js:1)

    at async C3.Runtime.Init (runtime.js:1)

    • Sorry for the late response, construct is not notifying me about comments... and it's been a busy week for me also.

      I can see where's the error, I'm relying on the global **window** object to listen to keyboard events, it should work perfectly on most browsers, but I guess that's not guaranteed.

      I haven't been able to find a recommended way to handle input in C3 (C2 relies on jQuery). I need some help that, if anyone knows of an open-source addon that uses keyboard to take as an example, I'd thank you.