Night-Ninja
Member
how would I go about making an object that when the player object is touching it and you press E you get taken to another room, thanks in advance
if(keyboard_check_pressed(ord("E"))) {
var _inst = instance_place(x, y, your_roomchange_obj);
if(_inst != noone) { room_goto(_inst.target_room); }
}
where should I put the name of the room I want it to take me to?You can use something like this in your player object, with the appropriate edits to fit your specific setup:
In short, if the letter E is pressed, get the instance of the "room chaning object" that's colliding with your player. If such an instance exists (as in, you are colliding) go to the room that's specified in that object "target_room" variable.Code:if(keyboard_check_pressed(ord("E"))) { var _inst = instance_place(x, y, your_roomchange_obj); if(_inst != noone) { room_goto(_inst.target_room); } }
never mind I figured out where to put it, thank you very much for your help I really appreciate it!You can use something like this in your player object, with the appropriate edits to fit your specific setup:
In short, if the letter E is pressed, get the instance of the "room chaning object" that's colliding with your player. If such an instance exists (as in, you are colliding) go to the room that's specified in that object "target_room" variable.Code:if(keyboard_check_pressed(ord("E"))) { var _inst = instance_place(x, y, your_roomchange_obj); if(_inst != noone) { room_goto(_inst.target_room); } }