Physics Based Movement

uMMORPG Forums Addons Physics Based Movement

This topic contains 32 replies, has 17 voices, and was last updated by  valcan 2 years, 10 months ago.

Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • #839

    Xamos
    Participant

    Hello everybody!

    I bring to you a new addon for uMMORPG. This enables you to use Physics-Based movement in uMMORPG for the player, while mobs can still use the Navmesh system. Currently the focus was to enable the player to do real jumps over obstacles and the terrain. More MMO style and less Diablo style.

    Asset Link: https://www.assetstore.unity3d.com/#!/content/96413

    ———————————————————————————————————————–

    Installation:

    1. On the Warrior (and Archer) prefab (located at “uMMORPG/Prefabs/Entities/”), Uncheck ‘Nav Mesh Agent’ and ‘Network Nav Mesh Agent’. Add a Character Controller. Set the Center Y to 1 on the Warrior, 0.96 on the Archer (or tweak to your heart’s content). Add the NetworkInput.cs script to the Player prefab. Also make sure you drag the Character Controller to the “Character Controller” slot in the NetworkInput.cs script.

    2. Open”uMMORPG/Scripts/Entity.cs” and remove

    from the top of the script (Personally, I would move them over to Monster.cs, if you do this you need to also add ‘using UnityEngine.AI;’ to the top of the Monster.cs script).

    Now find “public bool IsMoving() {” and replace that function (or modify) it with:

    3. Open “uMMORPG/Scripts/Player.cs”

    Search for “anim.SetBool(“MOVING”, state == “MOVING” && agent.velocity != Vector3.zero);” and comment out that line.

    Search for “string UpdateServer_IDLE() {” above ‘if (EventSkillFinished()) {} // don’t care’ Add:

    Search for “string UpdateServer_MOVING() {” just below that. Same thing, just above ‘if (EventSkillFinished()) {} // don’t care’ add:

    Search for “string UpdateServer_CASTING() {” and above ‘if (EventNavigateTo()) {‘ add:

    if (IsVectorMoving()) { return "MOVING"; }

    Now at the end of both “string UpdateServer_TRADING() {” and “string UpdateServer_DEAD()” { you should see a bunch of lines saying // don’t care. Add:

    if (IsVectorMoving()) { } // don't care

    below them.

    4. In the UpdateClient() in Player.cs make sure you comment out both of the “WSADHandling()” (WASDHandling in earlier versions, unknown why this was renamed). Comment out any “CmdNavigateTo” in the SelectionHandling() function.

    5. Open Edit > Project Settings > Input and add 2 more inputs. One called Sprint with the positive button value of “left shift” and one called Crouch with the positive button value of “left ctrl”. By default it should be easy but changing the “size” duplicated the last input, so if you last input is a mouse button it could be different. Mainly you want the Type to be Key or Mouse button.

    *Known Issues:
    – Currently you can attack mobs regardless of whether or not they’re in front of you.
    – It’s been reported that the collision will not work in the Editor for some reason, but works fine in Build mode.

    • This topic was modified 4 years, 2 months ago by  Xamos. Reason: Visibility/Functionality
    • This topic was modified 4 years, 2 months ago by  Xamos.
    • This topic was modified 4 years, 1 month ago by  Xamos. Reason: Updated instructions
    #842

    Mototron
    Participant

    • This reply was modified 4 years, 2 months ago by  Mototron. Reason: nvm
    #874

    Xamos
    Participant

    The asset has been approved and is now live! 🙂

    #961

    ikxux
    Participant

    Is it me or is this not working?

    #968

    comsuteado
    Participant

    This will not work in my environment either.
    When selecting a character, the following error message is output.

    Also, even if this issue is fixed, it will not be useful as it can not be debugged if it does not work in the editor.

    #970

    Xamos
    Participant

    Whoops, sorry wasn’t checking the forums lol.

    @ikxux – I updated the script and the instructions.

    @comsuteado – Yeah that was an oversight but it’s fixed in 1.0b. For some reason it wasn’t setting the CharacterController in Start() so I moved it to LateUpdate(). Also what do you mean it cannot be debugged if it doesn’t work in the editor? For me it works, you just need to make sure you add colliders to objects.

    Also check the installation instructions again because I updated it, but mainly:

    Make sure you drag the CharacterController on the player to the slot in NetworkInput.cs and also make sure you setup the Sprint and Crouch Inputs up.

    • This reply was modified 4 years, 1 month ago by  Xamos.
    #988

    comsuteado
    Participant

    @xamos
    Thank you for your quick reply.
    OK. I will check new installation instructions.

    > Also what do you mean it cannot be debugged if it doesn’t work in the editor?
    It is I that want to ask you that…
    This is your own remark.
    > – It’s been reported that the collision will not work in the Editor for some reason, but works fine in Build mode.

    • This reply was modified 4 years, 1 month ago by  comsuteado.
    #990

    Xamos
    Participant

    Oooohhh okay, yeah. That was one users experience with it, to be honest I myself haven’t had an issue with that and nobody else reported it to me either. So it could’ve been a fluke or maybe a missed instruction.

    #1015

    Dhoren
    Participant

    Hello,

    I just purchased this today.

    I’d like to rotate my character rather than move it left or right. Can you give me an idea of what I should modify?

    Thanks much.

    • This reply was modified 4 years, 1 month ago by  Dhoren.
    #1017

    Dhoren
    Participant

    I’m really liking this. I can make a pit in my dungeon now so that the player falls down into it it. I couldn’t do that with the navigation mesh because the player would just stop at the edge.

    #1019

    The Ebb
    Participant

    Just picked this up. It worked right out of the box first go at it, well done! I am seeing issues with smooth movement though. I am going to tinker a bit to see if I can fix the issue with stuttering movment I am seeing when running it on localhost. I am not seeing this on with the standard player controller. Other wise well worth the money, thank you.

    #1020

    Dhoren
    Participant

    Weird, I didn’t see any issues with movement. It looks pretty smooth for me. I tried it with server only + 2 clients.

    #1023

    The Ebb
    Participant

    Hrrm, well I will give it another go with a fresh project. See what happens, good to know it is just me, means I did somthing wrong and it can be fixed. Thanks for the feedback.

    #1025

    Dhoren
    Participant

    Hi Ebb,

    I see what you mean by the issue with stuttering movement. Sorry I didn’t notice these sooner.

    1. On the current client it looks fine but on the other clients when they move it looks like a problem with the moving animation.
    2. On the current client rotation is choppy but on the other clients rotation looks fine.

    #1038

    Xamos
    Participant

    Thanks guys! 🙂 I’m glad you’re enjoying this.

    @dhoren – The animation doesn’t seem to be updating on the other clients? Or is it delayed you mean? Also, Rotation on which client?

Viewing 15 posts - 1 through 15 (of 33 total)

You must be logged in to reply to this topic.