1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Image_speed with paths

Discussion in 'Programming' started by Halph-Price, Nov 29, 2017.

  1. Halph-Price

    Halph-Price Member

    Joined:
    Mar 20, 2017
    Posts:
    42
    So I was trying to animate when using paths:

    if xprevious!=x and yprevious!=y //when moving
    {
    image_speed=2
    }else{
    image_speed=0
    if PrevDir!=direction //when turning
    {image_speed=2}
    PrevDir=direction
    }

    Because I can't detect the objects speed or hspeed or whatever when it's moving along the path.

    It doesn't animate when moving horizontally or vertically. When It turns it animates and on the diagonals, I assume for the same reason.

    Am I doing something wrong, or is there a better way to animate movement during movement with mp_grid_path? I don't see any options to detect speed when moving along a path. I am open to any suggestions.

    Thanks for the time
     
  2. Dmi7ry

    Dmi7ry Member

    Joined:
    Jun 24, 2016
    Posts:
    481
    Code:
    if xprevious!=x or yprevious!=y
     
  3. Halph-Price

    Halph-Price Member

    Joined:
    Mar 20, 2017
    Posts:
    42
    Right. LOL. I am quite embarrassed now.
     
  4. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,839
    how about simply set the image_index off of path_position
    image_speed = 0;
    image_index = path_position * 100;
     
  5. Halph-Price

    Halph-Price Member

    Joined:
    Mar 20, 2017
    Posts:
    42
    interesting
     
  6. Halph-Price

    Halph-Price Member

    Joined:
    Mar 20, 2017
    Posts:
    42
    HOLY COW that works really good with adjusting the multiplier. Perfect, thank you.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice