A
Agletsio
Guest
HI there,
I want my player to hide in closet (called "obj_door") when I press "C". So my reasoning at the moment is to check to see if Player and closet objects are touching, then change the closet sprite and "hide" the Player object until you release "C" where it will go back to functioning normally.
Now I have managed to make the Door sprite change back and forth and making the Player object stop (speed = 0) when pressing and releasing the "C" key. What I'm trying to achieve now is hiding the Player sprite/object when "C" is pressed and make it return when "C" is released.
How would I go about doing that? I've tried playing around with "instance_deactivate" but is doesn't seem to be the right route. Is there a simple "object hide function" or something that will work? Also let me know if I'm approaching this the wrong way.
This is my current code setup in Player object's step event:
//Player Hide
var touch = place_meeting (Player.x, Player.y, obj_door)
if touch and keyboard_check(ord("C"))
{
speed = 0;
//This is where I tried placing the instance_deactivate function
}
Any help would seriously be appreciated!
I want my player to hide in closet (called "obj_door") when I press "C". So my reasoning at the moment is to check to see if Player and closet objects are touching, then change the closet sprite and "hide" the Player object until you release "C" where it will go back to functioning normally.
Now I have managed to make the Door sprite change back and forth and making the Player object stop (speed = 0) when pressing and releasing the "C" key. What I'm trying to achieve now is hiding the Player sprite/object when "C" is pressed and make it return when "C" is released.
How would I go about doing that? I've tried playing around with "instance_deactivate" but is doesn't seem to be the right route. Is there a simple "object hide function" or something that will work? Also let me know if I'm approaching this the wrong way.
This is my current code setup in Player object's step event:
//Player Hide
var touch = place_meeting (Player.x, Player.y, obj_door)
if touch and keyboard_check(ord("C"))
{
speed = 0;
//This is where I tried placing the instance_deactivate function
}
Any help would seriously be appreciated!