1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to make a player move in a straight line?

Discussion in 'Development' started by Pylay, Aug 3, 2018.

  1. Pylay

    Pylay Spider

    Messages:
    10
    Please tell me how I can cancel the player from moving to the left and right and the rotation (I want to do moving in a straight line).
    Sorry for my bad English.
     
    Last edited: Aug 3, 2018
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Are you familiar with the Cartesian Plane?
     
    corytortoise likes this.
  3. Pylay

    Pylay Spider

    Messages:
    10
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    That should be easy for you then.

    When you say a "straight line", do you mean a straight line from any point of reference or do you mean a straight line limited to exactly North, exactly South, exactly East and exactly West?
     
    corytortoise likes this.
  5. Pylay

    Pylay Spider

    Messages:
    10
    [QUOTE = "Muqsit, post: 55341, участник: 25"] Тогда вам будет легко.

    Когда вы говорите «прямую линию», вы имеете в виду прямую линию из любой точки отсчета или вы имеете в виду прямую линию, ограниченную точно Северным, точно южным, точно восточным и точно западным? [/ QUOTE]
    I want the player from the point to go only to the north and south
     
  6. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Maybe this will help: Minecraft Coordinates. Basically, just cancel PlayerMoveEvent if the X or Y value changes between the to and from point, I believe.
     
    Pylay likes this.
  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.