• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android Immersion haptic effect crash

jazzzar

Member
Hey, so i decided to add a little haptic effect to my game, so it does happen when the player touches an electric thing, when testing it on my android device using my usb cable, it just crashes immediatly upon the collision of the player with the electric thing, any help or is it a know bug? any help is appreciated :)
 

jazzzar

Member
Could we have a look-see at your collision code & immersion code ?
ofcourse you can, here you go :
Code:
if other.sprite_index=sHazard1 && !dead
{
    go=false;
    dead=true;
    sprite_index=sPlayerShock;
    image_speed=room_speed/120;
    if other.x > x
    {
        hspeed=-7;
        image_angle=45;
    }else
    {
        hspeed=+7;
        image_angle=-45;
    }
    vsp=-12;
    immersion_play_effect(46);
}else exit;
just a simple do some stuff code, dunno what's the problem
 
P

PlayLight

Guest
Doesn't seem to be related to immersion. I setup a small test project an replicated your variables and collision code and all worked ok when run via USB.
Code:
if ( other.sprite_index == sHazard1 ) && !( dead )
    {
    go              = false;
    dead            = true;
    image_speed     = room_speed /120;
    if ( other.x  > x )
        {
        hspeed   = -7;
        image_angle   = 45;
        }
    else
        {
        hspeed =+ 7;
        image_angle = -45;
        }
    vsp = -12;
    immersion_play_effect( 46 );
    }
else
    {
    exit;
    }
Are you getting any errors?
i see that you are using exit; if the collision object's sprite does not equal sHazard1. So if it does equal sHazard1 and dead == false, what else is executing in the collision event after the above code?
 
Last edited by a moderator:

jazzzar

Member
Doesn't seem to be related to immersion. I setup a small test project an replicated your variables and collision code and all worked ok when run via USB.
Code:
if ( other.sprite_index = sHazard1 ) && !( dead )
    {
    go              = false;
    dead            = true;
    image_speed     = room_speed /120;
    if ( other.x  > x )
        {
        hspeed   = -7;
        image_angle   = 45;
        }
    else
        {
        hspeed =+ 7;
        image_angle = -45;
        }
    vsp = -12;
    immersion_play_effect( 46 );
    }
else
    {
    exit;
    }
Are you getting any errors?
i see that you are using exit; if the collision object's sprite does not equal sHazard1. So if it does equal sHazard1 and dead == false, what else is executing in the collision event after the above code?
that's weird, after that code there's literally nothing, when the electrical thing is not off and the player isn't dead all of the above happens, else just exit the event and do nothing, so i don't know where the problem is, i'm using game maker studio pro 1.4.1757 if that helps in any way, think i'll go without the effect if it's now gonna work than, thanks for the help
EDIT : no, there is no errors at all, just crashes to the home screen of my phone
 
P

PlayLight

Guest
that's weird, after that code there's literally nothing, when the electrical thing is not off and the player isn't dead all of the above happens, else just exit the event and do nothing, so i don't know where the problem is, i'm using game maker studio pro 1.4.1757 if that helps in any way, think i'll go without the effect if it's now gonna work than, thanks for the help
EDIT : no, there is no errors at all, just crashes to the home screen of my phone
Did you check the "Harpic Effects" checkbox under Global Game Settings >> Android Tab >> General, and agree to the terms and conditions popup?
I've noticed that occasionally this will uncheck itself.
 

jazzzar

Member
Did you check the "Harpic Effects" checkbox under Global Game Settings >> Android Tab >> General, and agree to the terms and conditions popup?
I've noticed that occasionally this will uncheck itself.
that's the first thing i checked after the crash, i checked it now too to make sure it's on, and it is, soo :(
maybe an admin can see this and give the reason behind this? if it's android sdk related or what :/ @Nocturne
 
4

41nd

Guest
Haptics do not work for me neither. Tested with and without Android YYC.. Got a Xiaomi MI4i phone. Checked and accepted Immersion license but does not seem to work..
 

jazzzar

Member
Haptics do not work for me neither. Tested with and without Android YYC.. Got a Xiaomi MI4i phone. Checked and accepted Immersion license but does not seem to work..
yep i had to go without it, wasn't good but we need to sacrifice things :p
 
F

Florens Pauwels

Guest
Any more news on this? It's still broken for me. It crashed the first few times I try and now it's just doing nothing. When it crashed it gave a java error that said "java.lang.SecurityException: Requires VIBRATE permission" or something like that.
 

Aton Yeh

Member
It's a bug if you choose"Run The Game" directly,the game will crash when the game tries to play a Haptic Effect.You must choose"Create Application" and it works.
 
S

shuikun0

Guest
It's a bug if you choose"Run The Game" directly,the game will crash when the game tries to play a Haptic Effect.You must choose"Create Application" and it works.
Having the same problem and this selution work for my device(xiaomi4c & nexus5x)!
 
T

TheGameMakerGuide

Guest
Tried to use the Immersion Haptics effects in my game and it doesn't work.

EDIT:

Now it works!
 
Last edited by a moderator:
T

TheGameMakerGuide

Guest
Having the same problem and this selution work for my device(xiaomi4c & nexus5x)!
It worked for me too, just choose "Create Executable For Target".

Motorola Moto G2, Lollipop.
 

5you

Member
The checkbox for "Harpic Effects" doesn't exist anymore, how do you guys manage to make anything work ?
 

Mick

Member
The checkbox for "Harpic Effects" doesn't exist anymore, how do you guys manage to make anything work ?
The immersion functions have been removed from the most recent versions of gms due to licensing issues, so you need to use an older version (or an extension) to get haptics to work.
 
Top