PlayerOne
Member
Trying to add the ability to "travel" within the room. I have 2 doors - DoorA and DoorB - and that when the player presses E the player will warp to DoorA from DoorB and vise versa.
Problem is DoorA isn't working properly despite the fact it uses the exact code as in DoorB. However DoorB works without issue and that really doesn't add.
I disabled any code in my player object to rule out the problem and still nothing. I know I can use pre-determined x and y positions for this kind of stuff but this system is far easier to work with given the areas I'm building.
Any ideas?
Problem is DoorA isn't working properly despite the fact it uses the exact code as in DoorB. However DoorB works without issue and that really doesn't add.
I disabled any code in my player object to rule out the problem and still nothing. I know I can use pre-determined x and y positions for this kind of stuff but this system is far easier to work with given the areas I'm building.
Any ideas?
Code:
var _target = oPlayer
if place_meeting(x+0,y+0,_target) && keyboard_check_pressed(vk_e)
{
var Nearest = instance_nearest(x, y, DoorToDoor_B);
with(_target)
{
x = Nearest.x;
y = Nearest.y;
}
}