J
jana
Guest
After changing an obj_player to a different object, in the collision action:
I'm trying to change it back to an obj_player after a delay, but nothing is working. I tried putting this in the step event of the obj_player:
No error, and the instance changed into obj_player_neutral, but it doesn't change back. I also tried putting this in the step event of obj_player_neutral, and also creating a separate object and putting the above in the step event. Same non-response both times.
I also put the following in the step event of the obj_player_neutral and got the same non-response:
I did a search, and I see a lot of comments that refer to changing the new instance back, but I don't see any code or specifics on how to work with the new instance, except that you have to wait until the next step (how do you make sure you're not accessing it in the same step?), and that all the instance variables transfer over to the new instance.
Any help on how to change the instance back are gratefully appreciated.
Code:
instance_change(obj_player_neutral,0);
Code:
/// counter is declared and initialized in the create event
if (object_exists(obj_player_neutral))
{
if (counter > 0)
{
counter--;
}
else
{
instance_change(obj_player_neutral,obj_player)
}
}
I also put the following in the step event of the obj_player_neutral and got the same non-response:
Code:
/// counter is declared and initialized in the create event
if (counter > 0)
{
counter--;
}
else
{
instance_change(neutral,obj_player)
}
}
Any help on how to change the instance back are gratefully appreciated.