Solved Adding acceleration/deceleration to a horse.

Discussion in 'Plugin Development' started by Symphonic, Jan 16, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    Symphonic

    Essentially what I am trying to do is add smooth acceleration/deceleration to a horse to use it as the main moving part for a spaceship plugin. I tried a lot of stupid things that most definitely didn't work and I realised that modifying velocity of a horse that is moving yields really unpredictable behaviour where the velocity you set and the velocity the game is setting from the movement kind of fight against eachother. Anyone have a simple way of doing this? Thanks.
     
  2. Offline

    Kars

    There is no smooth way of doing this because of the way movement works.
    Server-side movement will be bumpy from your perspective due to latency and such. Movement is entirely handled by the client; the server generally only verifies. It is like this with all games.

    Smooth server-side movement is not achievable.
     
  3. Offline

    Symphonic

    I think I may have mis-worded this a little.. it's not like.. jittery, its like lets say I was setting Velocity to 10 0 0 when you are moving in the +x direction you go really fast and when you are moving in the -x direction you barely move, as if it was adding instead of setting.
     
  4. Offline

    Kars

    Then you have to figure out the way velocity works.
     
  5. Offline

    Symphonic

    Is this like you telling me that I don't get how to fix it or you telling me there is no way of fixing it
     
  6. Offline

    Kars

    The first one probably but i can't say for sure.
    Sounds to me like if 10 0 0 moves you fast towards +x but slowly towards -x, the first digit is the x movement. Logically -10 would move you fast towards -x.
    I could be wrong.
     
  7. Offline

    Symphonic

    yes but the thing is setting it to 0 does not freeze you and setting it to - the velocity of the horse also does not so its just really dumb.
     
  8. Offline

    Niv-Mizzet

    @Symphonic use the launchprojectile method for movement, and use the space bar for acceleration and deceleration(increase the velocity of the vector) as horses have a jump bar
     
  9. Offline

    Symphonic

    Don't think I can track that as the horse jump bar is client sided.. The launchprojectile might work but now comes the issue of getting input.. I've been stuck in a loop like this for a while figuring out how to get some input from the keyboard while also moving the entity the way I want...
     
  10. Offline

    Niv-Mizzet

  11. Offline

    Symphonic

    #2 is constant and has nothing to do with when the player jumps

    I could use #1 but i feel like that’s a terrible control scheme, I think im gonna go the route of trying to intercept movement/input packets and then modify the movement based on that. Thanks for the help though, I will definitely use the spacebar for some part of the controls and this might make it easier.
     
Thread Status:
Not open for further replies.

Share This Page