• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

lerp

  1. helpless_coder

    GMS 2 How can I determine distances in fake 3d?

    [CLOSED] Got help from the Math discord, and they came up with this solution: if (relative != noone) { var start_point = argument1; var end_point = argument2; var input = argument3 if (input > 100) input = 100; else if (input < -100) input = -100; var distance =...
  2. F

    GML view follow issues

    I'm currently working on a top down adventure game where the view follows the player (original system created by Heartbeast): //this Code is in the step Event of the view object //update view position view_xview[0]=(x-view_wview[0]/2); view_yview[0]=(y-view_hview[0]/2); //move view towards...
  3. V

    How do I get these two co-ordinates?

    Heyall I'm using the draw_sprite_pos function to draw a sprite on an angle according to a top-central horizon point. With the help of image scaling I have determined the top left and right two circles and their respective x and y positions. (green) as well as the bottom blue circles y...
  4. tomtinderbox

    GMS 2 How to calculate steps needed for lerp() to hit target value in step event?

    Greetings, I'll come in hard and true: I suck at mathematics. I know that: xx = lerp(xx, 10, 0.25); Can also be written as: xx = xx + ((10 - xx) * 0.25); Let's say I give xx a starting value of 100 in a create event and I put the lerp() function above in the step event. How can I calculate...
  5. ProjectGamesInc

    GMS 2 Problem Rotating Sprite + Lerp

    Hi all, I'm trying to rotate an enemy that is following a path. using image_angle = direction works but it gives me the "lag" (it dosent change smoothly the angle) effect beacouse the enemy is moving slowly and i have big difference beetween the "past" direction and the "actual" one from step...
  6. Edwin

    GML Linear interpolation (lerp) analogues?

    I want to slowly "move" my value from, for example: 2 to 0 without "this": Sometimes, values that need to slowly decrease or increase are starting to "twitch", trying to get into a certain interval or position. How to fix it?
  7. K

    Lerping the camera

    Hey guys, So when rotating the camera in my game 90 degrees im coming across a problem with going from 270 - 360. because it treats the camera angle as 0, not 360, it causes the camera angle to whip around in the opposite direction. here's my step code for setting it. if global.grav = 1 {...
  8. Shadowblitz16

    GMS 2 lerp text position left to right?

    can someone help me figure out how to lerp my text and value positions? basicly I have 3 major variables that I use - left // the left position of the text when its enabled but not selected - right // the right position of the text when its enabled and selected - width // the...
  9. A. DeVivo

    parallax background on the y axis

    Hey all! First time posting! Fairly new to GM2 but learning. In order to create depth on an island level, I'd like the horizon level of the ocean background layer to somewhat follow the player/ be fixed to the camera as the player/camera descend the y axis. I've been toying with lerp to do...
  10. seanm

    GML Camera Lerp isn't actually smooth.

    Hey, it's been a while since I've been on here. I'm back with another issue that most people will likely find to be too small to worry about, but I'm worryin about it. My Problem I'm using lerp to smoothly move my camera to my players position. Super basic camera that everyone does. x +=...
  11. kamiyasi

    GML Lerping shortest distance in a circle?

    Here's my scenario. It's a twinstick shooter and right now I'm working on the keyboard controls. On a keyboard the player uses the arrow keys to aim. To emulate the smoothness of analog aiming, I am currently using lerp. For the most part this works fine, however, when lerping between a low...
  12. tamation

    [SOLVED] Lerping a menu cursor?

    I'm pretty new to the lerp function in gamemaker, and I was wondering if there was any way to use it to make a smooth movement effect for a menu cursor when moving up and down? My old code was "if ukey { y -= 16; } but I'd like it to have a smoother effect when moving up. So I looked into...
  13. Bingdom

    Smooth Text

    Hello GMC community! I have been trying to do a smooth text transition that will appear for each new wave. So far I've made the script to work, but the line of code makes the text jump halfway across the screen without starting from the left side. I understand why it does this but i don't know...
  14. C

    Legacy GM Problem with Lerp and Angle

    Hello guys! So basically i cannot figure out how to get a smooth transition from 360 to 0 and 360 to 0. Here is a demo https://dl.dropboxusercontent.com/u/10402000/LerpAngle/index.html and this is the code i use. image_angle = lerp(image_angle, point_direction(x,y,mouse_x,mouse_y), 0.05);
Top