1
  • I am trying to make a "teleport" feature in gamemaker.
  • When you hit spacebar, the teleport state occurs. The teleport object teleports to the player (because it speeds the game up if its not teleporting when the player doesnt need it), then it gets the direction the player is facing, then it teleports the teleport object a few pixels away a few pixels at a time(this makes it so that I can make sure the player wont hit any walls when teleporting). then it teleports the player to the teleport object. If the teleport object hits a wall, it will stop (thats what the earlier bit was about) The code is fairly simple, but when I hit space, the teleport object doesnt move in the slightest.

    ///Teleport state // Teleport player objteleport.x = objplr.x; objteleport.y = objplr.y; // --> right here is an error that says "unecessary expression state used as a statement", but that appears no matter what I type on the 4th line

    objteleport.x += (hspd*10); objteleport.y += (vspd*10);

    objplr.x = x; objplr.y = y;

    state = scrmovestate;

0 Answers0