How to use ‘wasReleased’ with gamepads

I’m working on controller support for my game and one of my scripts has a wasReleased command but when I used the same code but set it up for gamepads and got an error saying
“ (pc.PAD_1, pc.PAD_FACE_1)” is not a command

if anyone knows why this is happenin and how to fix it I’m all ears.

William Boersma

Have you enabled gamepads in the projects settings?

@yaustar yes I have got everything working except this last thing.

@yaustar HERE is the code
if you want to take a look

How do you repro the error message?


How do you reproduce the error message? (eg which scene to load, what actions do I have to do in the app?)

load level 7 - level 11

@yaustar the error went away now it just does nothing

There seems to be an issue with wasPressed that I will look at.

However, moving around with the joystick worked fine for me. If you can’t move around with your controller, try using this site to test your pad:

Fixed in PR:

hey @yaustar it still doesn’t work?
can you take another look over my code and see if there is anything wrong.
also like I said before everything works fine with the controller except this.

It’s right here

@yaustar the error came back

[Launch.js?id=36884907&branchId=b54e717d-51a8-41a2-8464-cdf777c7a322:10]: Uncaught TypeError: is not a function

Hi @WilliamBoersma31,

I gave lvl11 a try and it works quite ok, I can move around without getting any error.


if you beat a level then the game crash’s

[Launch.js?id=36884907&branchId=b54e717d-51a8-41a2-8464-cdf777c7a322:10]: is not a function

TypeError: is not a function
at scriptType.P2Lauch.update (
at ScriptComponent._scriptMethod (
at ScriptComponent._onUpdate (
at ScriptComponentSystem._callComponentMethod (
at ScriptComponentSystem._onUpdate (
at Function._helper (
at Function.update (
at Application.update (

There is another forum topic about this problem. I wonder if anything has changed since then.

Hi @Albertos I tried using that topic’s solution and it did nothing.

If there is still no working wasReleased function for gamepads I think you can do something like below.

var pressed = false;
if (pressed && ! {
    pressed = false;
    // Your wasReleased functions here

else if ( {
    pressed = true;
    // Normal isPressed functions here

@Albertos how do I call pressed would it be

if (pressed) {
‘my code’


if (pressed) {


else {
‘my code’