Diagonal Movement For Objects

Discussion in 'How Can I...?' started by patostar, Apr 26, 2019.

  1. patostar

    patostar Avid Boxer

    Joined:
    Jan 27, 2018
    Messages:
    483
    Likes Received:
    86
    I am using transform logic to make objects move, but it can work only straight left and right and down and up, but I want the object to move in a diagonal direction like 45 degree, how do I make it happen?
     
  2. Ivan Perfetti

    Ivan Perfetti Avid Boxer

    Joined:
    Sep 9, 2018
    Messages:
    203
    Likes Received:
    181
    @patostar Hi, I'm not sure I've correctly understood what you mean but in BB2 you may set both X and Y fields of linear velocity modifier so if you set both at the same value, positive or negative depending on which of the four diags you desire, you'll get 45°.
    In the attached picture a transform from my game Tchupiki which changes the linear velocity of the colliding platform so that it moves up and right at a speed of 2.4 and 6, which is an angle of about 20°, if it were 6 and 6 the angle would be 45°.

    upload_2019-4-26_19-3-40.png
     
    Jaro likes this.
  3. patostar

    patostar Avid Boxer

    Joined:
    Jan 27, 2018
    Messages:
    483
    Likes Received:
    86
    Oh man thanks a lot, finally I am able to do the 45 degree movement lol, I tried many times but couldn't get it to work, this is important for my game, because moving left and right, up and down is getting boring, I needed this 45 degree, thanks again :)
     
  4. Jaro

    Jaro Avid Boxer

    Joined:
    Sep 21, 2018
    Messages:
    387
    Likes Received:
    126
    Hi , how we can do similar movement for character? Eg. 45 degree character swipe. Many thanks
     

Share This Page