GMS 2 2 problems D:

S

Sroft

Guest
Ok so I have two problems and decided to post it to one thread
My first and most important problem is I have my player pick up a gun by colliding with it that works perfectly fine BUT when i leave that room and go to the next the gun is no longer with my player I dont know what code to put with that so any ideas would be amazing
My second problem is i have s script here
if (!place_meeting(x,y+1,WObject)) and WEAPONS_MODE.HANDS
{
sprite_index = PlayerA;
image_speed = 20;
if (sign(vsp) > 20) image_index = 1; else image_index = 1;
}
else
{
image_speed = 1;
if (hsp == 0)
{
sprite_index = Player;
}
else
{
sprite_index = PlayerR;
}
}
if (hsp != 0) image_xscale = sign(hsp);
for when my player is unarmed but the problem is when i jump(PlayerA) it dosent do the animation but when I have a gun like my gun script here
if (!place_meeting(x,y+1,WObject)) and WEAPONS_MODE.PLASMA
{
sprite_index = sPGunPlasmaA;
image_speed = 20;
if (sign(vsp) > 20) image_index = 1; else image_index = 1;
}
else
{
image_speed = 1;
if (hsp == 0)
{
sprite_index = sPGunPlasma;
}
else
{
sprite_index = sPGunPlasmaR;
}
}
if (hsp != 0) image_xscale = sign(hsp);
the jump animation works fine
plz help and thank you
 

RollyBug

Member
Hello! In the future please make your thread names more descriptive; it helps everyone out.

For problem one I suggest making your object persistent so it carries over its information from room to room.
See here: https://docs2.yoyogames.com/index.html?page=source/_build/index.html

For problem two, please elaborate a bit. What do you mean by "it doesn't do the animation?" Do the jumping mechanics work properly? What does the animation look like? I suggest that you try debug messages to isolate the problem, seeing which if-blocks are being run.
 
S

Sroft

Guest
Hello! In the future please make your thread names more descriptive; it helps everyone out.

For problem one I suggest making your object persistent so it carries over its information from room to room.
See here: https://docs2.yoyogames.com/index.html?page=source/_build/index.html

For problem two, please elaborate a bit. What do you mean by "it doesn't do the animation?" Do the jumping mechanics work properly? What does the animation look like? I suggest that you try debug messages to isolate the problem, seeing which if-blocks are being run.
Thanks for responding and sorry for bot making my thread to clear!
But when I made my object persistent it still does not transfer over
and when i mean it does not do the animation, when i jump it just looks like im running in the air instead of doing the animation I want it to do
Thanks for helping me!
 
Top