Object changes into another - but can't change back?

My player takes different forms and I have different objects for them, so I'm trying to control them in my controller object..

CONTROL object:
GML:
if keyboard_check (vk_space) and object_exists(ob_player)
{    with ob_player instance_change(ob_cat,true);
}

else

if keyboard_check (vk_space) and object_exists(ob_cat)
{    with ob_cat instance_change(ob_player,true);
}
I'm sure there's a better way to create a binary switch, but I clearly don't know it.

I also need help assigning the new object the same viewport and back again.

Any help appreciated. Thanks.
 
I switched out object_exists for instances_exists and switched keyboard_check for _pressed and it worked! So thank you for that.

Can you point me in the right direction regarding switching the viewports. When I switch to ob_cat, the camera doesn't follow it anymore.

I have it set up in room setting as viewport[0] follows ob_player and the same dimensions in viewport[1] follows ob_cat.

I'm having trouble switching back and forth though. Any ideas?

Thanks.
 
Top