1. E

    Using Sin with move_towards_point.

    I'm currently learning to use Sin from an old post from Gre_Lor12: This is the code: var Amp = 20; //How "Stretched" the wave is var Freq = 10 //How much to increase the waves amplitude by (in px) x = xstart +...
  2. Elgarion

    GMS 2 Speed issue with mp_potential_step & move_towards_point

    Greetings! I have a little trouble with the differences of speed value between 'mp_potential_step' and 'move_towards_point'. I have a npc who must sometimes avoid obstacles, and sometimes not. By default, I use 'move_towards_point'. When it must avoid obstacles, I make it switch to...
  3. A

    Legacy GM How does the player go in front of an object when you click on the object?

    Hello, everybody. I have a question in Game Maker Studio 1.4. I am still a beginner and need help with a Point and Click Adventure. I have a player who can be controlled by Point and Click by creating an object. This object is moved as soon as the left mouse button is pressed. The player then...
  4. D

    GMS 2 How to move a object to a coordinate

    So, im really new with the engine and I have really little experience with java so i ask sorry beforehand for my english and my newbie skills. Anyway im trying to make a title screen, so I made a sprite with the the tile put it in an object and put it in the first room, I made some lines of code...
  5. A

    Windows Crazy movement object

    I'm making a game about dark holes and gravity, but i can't figure out how to make work the move_towards/direction function dark hole gun step code (Gravity Traveler): DarkHole=0 if keyboard_check(ord('A')) {DarkHole=1} else {} if keyboard_check_released(ord('A')) {DarkHole=0} else{} Or the...
  6. MartinK12

    GML [SOLVED] if keyboard_check_pressed then move_towards_point not stopping obj

    If player pressed "Z" then obj_player should move towards x,y of the obj_pos_z and if within 10 pixels from it, obj_player should stop. In obj_player in step event there's only below code, but obj_player won't stop and if player presses "Z" again obj_player change direction and move towards x,y...
  7. ArtCode

    GML Make the player stop before even using "move_towards_point"

    Hello, Thanks for your time for reading my question! So, the problem is this... I have a Player that moves with the click with a mouse. This is my code and it's working great: _speed = 4; mouseDistance = point_distance(x, y, obj_Dot.x, obj_Dot.y); move_towards_point(obj_Dot.x, obj_Dot.y...
  8. G

    GML move_towards_point (bottom of obj)

    Hi! I'm trying to get my character to move down to a certain spot when he goes to open a door (so that it actually looks like he's grabbing the handle) so I need his sprite to line up with the door's sprite. So I'm using the move_towards_point method to have him slide to the door but I can't...
  9. B

    move_towards_point in alarm

    Hi! I use the move_towards_point function, but I have a weird issue. If I use it in the STEP event, it’s works perfectly, but in ALARM it” “vibrating” on the endpoint. // with STEP (it works) //Step: if (global.ACTION = 1) { DISTANCE = point_distance(x, y, 32, 160)...
  10. L

    I need help

    So I’m trying to make it so that the same object will go toward the other object if it collides with the drawn circle Also the problem is that it keeps going toward itself
  11. P

    GML move_towards_point

    So I'm working on a new game with space ships. the goal is to destroy the other ships. with my object when they come near the enemy onject the ship will start to shoot the nearest obj of the enemy. For example: obj_frigate (your ship) is in 128 distance to obj_enemy_frigate now will obj_frigate...
  12. J

    Move towards point while key is pressed

    PEOPLE Help me out here. I want my player to move towards the mouse point ONLY WHILST my left mouse button is held down. I've tried while loops but they seem to just crash the runner and I cannot find a fix. Other than that I can only get the player to move toward the point the mouse was at...
  13. C

    GML Object stuck between two pixels

    So I have an enemy object that follows the x value of the player character. The code I use is this (the shield is the enemy object): move_towards_point(obj_player.x,obj_shield.y,2); When the player object is moving, it works pretty much fine. However, if the player stops and the enemy catches...
  14. calebjross

    GML problems stopping move_towards_point

    Hello, I'm new to GML (I recently finished Benjamin Anderson's Udemy course). I thought I had the basics down, but I am embarrassed by what is likely a simple problem. I searched the docs, searched other forums, but I cannot find anyone who admits to making such a basic mistake :) First, the...
  15. B

    Trying to spawn and object, and then making it move to a certain point, and then move to an object.

    This is the code i've written now. { while (obj_LETTERS.x <= 800); { move_towards_point(800, obj_LETTERS.y, 5); } while (obj_LETTERS.x >=800); { move_towards_point(obj_doggo.x, obj_doggo.y, 5); } } where obj_LETTERS is the object that is moving from the left side of the screen, and obj_doggo...
  16. A

    GML is there a "move_away_from_obj/inst" type function?

    hi all. is there a function that is opposite to the "move_towards_point(...)" function? specifically, is there a function that makes an object move away from another point? if not, any suggestions on how i can code a script that would function as one? i done know where exactly to start. thanks!
  17. A

    Legacy GM [solved]move towards above an enemy and stop

    I'm making a game in which the player can fly and carry enemies, I make that if the character is flying, is close to an enemy and the player push a button to grab the enemy, the character x and y is set to the enemy x and y-100,so the character appear above the enemy, but it looks kind of bad...
  18. S

    Need help making an object move towards a point 32 pixels at a time.

    I am working on a game with grid-based combat and movement similar to fire emblem or xcom. I have it so each tile on the map is a different object. When the tile is clicked on, I want the player object to move toward it but along the grid (not diagonally). The tiles' x and y coordinates are...
  19. Wuzzems

    Legacy GM [SOLVED] Vibration, speed not stopping.

    I have an object that is moving towards the left and which is supposed to stop at a certain point yet it keeps going and won't stop it's speed. Here's the code: Create event: // pink block position pinkposition = room_width = room_width - (room_width * 0.992); // y position of instance var...