point_direction

  1. G

    Help with image_angle being a point_direction based

    Hello. I'm trying to make my weapon look at the mouse position, but, it is acting weirdly wrong. the white line is what i've wanted to the angle to be the weapon position and direction is controlled by the player script heres the code: if weapon { var mb = mouse_check_button(mb_left)...
  2. hakase22

    GML Problem with dynamic point_direction, my object starts vibrating if it tries to follow a target.

    Hello guys, I'm new here, I could not find a solution to my problem so I thought was good to explain it by myself. Long story short, I have this bullet that needs to reach a target with its direction that changes dynamicly using its x and y value. So, I use the point_direction( ) function, and...
  3. J

    Top-Down Racing Point_Direction affected by speed

    I'm trying to have the player angle turn to the direction of the mouse which is simple enough, but I don't want them to be able to turn whilst they have stopped. Additionally, I want the point_direction to be affected by how fast the player is going - so the faster the player is moving, the...
  4. D

    SOLVED Camera follow makes mouse position shaky

    Hello everyone! First, here's the video showing the problem: (sry for the bad video quality, but it is enough šŸ˜‚) As said in the title, the problem lies within the camera. Basically when my camera is following the player, the mouse position gets shaky (the white square at cursor in the video...
  5. D

    GML Direction returning from point_direction changing when moving

    Hello everyone! So, i'm having a problem with point_direction which keeps the returning value swinging when i'm moving my character around. The problem is that i use 8 direction sprites, so if i try to walk close to direction change value it keeps going back and forth making the animation...
  6. F

    How do i achieve "slippery movement" / difference between two directions

    So i want to create an enemy AI that charges tword a player but has like a simulated friction/delay. kinda like as if it were running on ice, so it starts still and builds up speed in your direction to try and ram you. But if you dodge him he shouldnt continue moving tword you but in the...
  7. O

    How to rotate the moving triangle in the direction of motion?

    Create Event: execute code: image_angle=direction Step Event: execute code: direction = point_direction(x,y,mouse_x,mouse_y) image_angle = direction Draw Event: execute code: draw_set_color(c_red) draw_line(x,y,x+lengthdir_x(400,direction+30),y+lengthdir_y(400,direction+30))...
  8. A

    Legacy GM [SOLVED] Having trouble implementing clamp (for image rotation)

    Holaarrgghhh! I'm working on implementing a flashlight that the player should only be able to rotate a set amount depending on the direction they're facing - should be easy, right? Well, I've got the flashlight working, and code that makes sure it's facing the right direction according to the...
  9. J

    GML unexpected behavior with point_direction

    Hello! I've been working away on my game and I've run into something that has been far more difficult to do than I expected. My game is a sidescroller and I'm trying to make my character shoot up. I've had a few near successes with it, but no matter what I do its not quite right, and I'm really...
  10. E

    GML [SOLVED] Smooth "point_direction" problem.

    VIDEO: Hello! I have a problem with the angles, using point_direction. So basically, hammer weapon (object) have this Step Event code to return the direction of mouse position: mouseDir = point_direction(x, y, mouse_x, mouse_y); image_angle += (mouseDir - image_angle) * 0.25; This works...
  11. PlayerOne

    GameMaker Having an arm "snap" depending on player position? (point_direction) [SOLVED]

    Currently I'm using point_direction() to have my enemy arms point in the direction of the player. While okay for right now I need to know if there is a way to use point_direction to have it snap in eight ways (90,180,270,etc) and still have it pointed at the player? var dir =...
  12. A

    Legacy GM [SOLVED]image angle problem

    when holding the left mouse button, the player will do a blowing ability that aims towards the mouse, the problem is that before blowing in the direction it's supposed to, it appears to the right of the player obj_player create: changedir = true // blow ability canblow = true // if able to...
  13. O

    Circle Rotation With Touch

    Hi, i am working on this game where i have a circle and i rotate the circle with finger touch. The problem i am having is that every time i begin to touch the screen, my circle jumps to that angle. I want that wherever i touch, the circle should rotate keeping its angle relative to the touch...
  14. G

    Can someone help me with my simple problem?

    I know this is dumb question and i would appreciate if someone answers me, so i created a turret and i want it to always point at the obj_player whats the code for that tho, i experimented with point_direction but it didnt work
  15. T

    Freeze sprite Angle/Direction

    Hi, I've a obj_player direction (movement state) based on the mouse cursor and the center of the room. direction = point_direction(room_width/2,room_height/2,mouse_x,mouse_y); image_angle = direction; I've create a sprite sheet for the attack. During the attack animation I want to: 1) move...
  16. mar_cuz

    GameMaker Lock Joystick Movement To One Angle

    Hi All, I'm trying to have my player move with the left stick of a game pad but back and forth on one angle only. So the angle can be: push_angle = point_direction(oGoal.x,oGoal.y, x,y); I only want to move on that axis (push_angle) back and forth and the player cannot move from that angle...
  17. O

    Legacy GM Distance between two objects

    i have object0 and object1. An object0 can be moved by player control. I want every few seconds an object1 moves only in the direction of an object0 and does not follow it. This is the line of code: var bullet bullet = motion_set(point_direction(x,y,object0.x,object0.y),6); It works fine but I...
  18. N

    Limit rotation speed with image_angle = point_direction(,,,)

    Hello! Does anyone know a way to limit the rotation speed? In the players step even I just have this code to handle rotation. image_angle = point_direction(x, y, mouse_x, mouse_y); Thanks in advance!
Top