Search Unity

World of Warcraft Camera and Character Controller

Discussion in 'Assets and Asset Store' started by fholm, Mar 2, 2012.

  1. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    sent a link to the package
     
  2. koen.pis

    koen.pis

    Joined:
    Mar 24, 2011
    Posts:
    66
    1.1 did improve mesh collides for me. There where still some meshes that gave issue's but increasing the body radius on character motor fixed most of those. also damm looping true triangles of a mesh ? *shivers*

    I still prefer the old school way do, when mesh colliders pop up I put a baseball bad on my desk and point in general direction of level designers. Makes them remember and dive in to fix the issue asap ... mesh colliders are just bad and can be avoided 95% of the time.
     
  3. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    I agree with this, and yes I know the fix for the mesh colliders is a bit dirty and I have an point cloud based one scheduled for 1.2 which will arrive later today or tomorrow :)
     
  4. luvaduva

    luvaduva

    Joined:
    Feb 26, 2012
    Posts:
    10
    fholm,

    I purchased the controller. So far so good.

    What are your thoughts about adding a side step movement to the controller?
     
  5. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    You mean strafing? That is already in, just that the default model shipped with the controller doesn't have a strafe-animation so I chose to rotate the model in the animator.
     
  6. luvaduva

    luvaduva

    Joined:
    Feb 26, 2012
    Posts:
    10
    Yes. Perfect. =)
     
  7. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Submitted 1.2, with a lot of improvements to mesh collisions

     
  8. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    Looks great and I did get the animation issues fixed by going through and thourougly setting up the character controller exactly the same as the demo. I did have to change the animation speed modifier values to extremly low though to get them to animate at the right speed. Strafing and everything work now :) thanks for the support and can't wait to get 1.2 imported. Also wanted to ask about the stairs, I sent you 3 diff models 2 had 2 different types of stairs any luck on getting those working?
     
  9. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
  10. AllSynergy

    AllSynergy

    Joined:
    Nov 1, 2011
    Posts:
    47
    Well I bought it :D
    Doing mobile stuff only and don't know if I can actually find use for this but it is cheap and you've obviously put so much effort to it :D... just have to test it.
    I hope I can modify it for some mobile games... shouldn't be impossible. Your minimap solution looks kind of nice as well. Keep up the good work.
     
  11. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    I'm working on creating mobile version of my most popular assets :)
     
  12. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    hey fholm i found another bug :x. If you try to collide with a tree with a capsule collider it works initially unless you jump forward you end up looking like your stepping up onto it and it slides you up in the air a bit and you go straight through the tree o_O also i cant collide with unity terrain trees even with capsule colliders.
     
  13. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    I'll look into both of these right away
     
  14. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    I also found an issue with the new mesh collider support, if your inside a house and you jump the controller stops working i cant move anymore it stays in the last state so if i was running i would be stuck in place running and my character wont move anymore.
     
  15. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    This is a similar problem that I've been having since the new update. Jumping around normally is fine on the same ground level but when I would jump down to the next floor below my character would get stuck in mid air. This happens with the capsule collider applied but when I don't have it my character doesn't move at all, just stuck in place though the camera and controls are working fine.
     
  16. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    This works very well, I'm quite happy with it! I did have one minor thing that kind of bothered me a little. I found that when walking off a platform, that you didn't keep momentum of your movement that sent you off the ledge (so no forward momentum), and that it appeared as though you instantly started falling at max velocity (or maybe not, but it was hard to tell). It's not something that I can't fix with a bit of tweaking though, and I'm quite impressed overall!

    Edit: Actually, it just seems you don't get any forward momentum until it thinks you're falling, so you get a weird fall trajectory like this:



    I found though that setting Fall State Time to 0 removes this problem entirely. Actually setting it to 0 doesn't really cause any issues other than playing the landing animation on small jumps. Fixing it so it didn't do that was quite easy. :)
     
    Last edited: Mar 17, 2012
  17. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
  18. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Hey guys, thanks for all the feedback, I got an update planned (1.3) which will hopefully fix all the small remaining issues.
     
  19. BruwtForce

    BruwtForce

    Joined:
    Mar 17, 2012
    Posts:
    23
    Purchased this yesterday, and for the most part I love it, but there are a couple of very small issues that I'm running across.

    The first is this: When you 'right click' and drag (Mouse Look) the mouse pointer snaps immeadiately to the center of the screen. Given the package is based on WoW control, what I expected to happen was for the pointer to vanish while the mouse look is in progress, and then when released the mouse pointer would reappear where it was originally. I hope that makes sense. It's a minor irritant, but potentially problematic to me.

    The second issue, and one that concerns me a little more, is this: If you run your character into a collision box/sphere etc. and keep running it will occasionally create an unpleasant visual. It's kind of hard to explain, but it's like all of the visible textures on the screen blur, and begin to slightly vibrate. It something I can reproduce very easily in both my test scene, and the demo that came with the controller.

    Finally, I don't understand the point behind the InvertRunWalk. I can't think of where or why one would use it - maybe you could enlighten me. I'm sure it's there for a reason, but I can't for the life of me think why.
     
  20. BruwtForce

    BruwtForce

    Joined:
    Mar 17, 2012
    Posts:
    23
    Just come across another problem, but this one could be entirely my fault, or even just a basic misunderstanding on my part on how mesh colliders are supposed to work.

    If I put a mesh collider onto a basic rock, then the character will just walk right through it; however, if I jump onto it instead, it lands on top and the collision works as one would expect.

    Is there something special that I should be doing with mesh colliders? I noticed you had no mesh colliders in your demo, which makes me wonder if there is a problem with them. Any ideas?

    I also tried to place a mesh collider onto a medeival buiilding, but I think that failed because the triangle count was potentially too high - at least that's what I assume based on what I have read about mesh colliders today; however, the rock was definitely well below the 223 (or whatever triangle limit the docs state).
     
    Last edited: Mar 17, 2012
  21. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    Another funky thing I found, it bugs out if the ground goes to or below 0 y height. It will prevent you from walking on said ground, and if you attempt to jump, you just float up into the air and become unable to move. Moving the ground up will allow you to keep moving. It caught me because if you just create a blank terrain or plane and position it at 0 y, you won't be able to move until you move it up a little.
     
  22. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Efraser2007, BruwtForce, Doddler: good catches! I have an 1.3 planned and have started to go through the code with a fine tooth comb, I think I mananged to mess something up a tiny bit when doing the mesh collider implementation.

    New version will soon be out, with all fixes :)
     
  23. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    Thanks fholm! Also make sure you look at the Run/Walk code because it still runs when you toggle run off just runs the animation slower ;)
     
  24. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Yeah, already re-written the input controls + the animator fully.
     
  25. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    awesome, i had a question about your minimap system, can it display more than 1 area as in my Zone Engine i wrote loads scenes additively async as the player is walking through the world.
     
  26. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Yes you can, easiest is if you use unity pro you can just call the redraw function on the minimap to update it once you've moved the center of it. otherwise you will have to do the texture stiching manually during runtime and update the map texture.
     
  27. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    Sounds good ill purchase that aswell now :) as well as the spell effects, now do you have any knowledge about how much projectors effect performance? I am going with a very high level of detail graphics but want to make sure im getting close to atleast 50+ fps max detail with my current card which is a Nividia GTX 550 TI 2gb
     
  28. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    Ah, so that's the problem that I was experiencing, good catch!
     
  29. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    I guess you have not played with games that you control only with only the directional keys.
     
  30. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    A few other minor issues. I hope you don't mind looking at them, it's been great working with this otherwise. :)



    1. When going up a step that is very close to the max height you can go up, you get stuck in falling animation and can't control your character until you slide off the collider. (Just using box colliders).

    2. This one was weird, you can walk up and down this ramp no problem, but if you jump, you get stuck in the falling animation until you hit the ground. I couldn't reproduce it in the video, but you can easily get stuck where the collider connects to the ground. Again the platform is just a box with a box collider.

    3. A minor nitpick, if you jump while strafing, your character rotates to face forward while jumping even though that's not the direction the jump is being made.

    Not shown: Another minor nitpick, if you rotate the camera in a random direction, and then right click to have the character rotation match the camera, the character will instantly snap to that direction rather than rotate smoothly.
     
  31. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    Good find on those bugs. That quick snap of the character to the direction of the camera after clicking right click is normal, it's what all MMO's have, though I guess an option to have it rotate smoothly to the direction would be good to have for those who like to have it that way.
     
  32. EarthLaunch

    EarthLaunch

    Joined:
    Mar 7, 2012
    Posts:
    62
    This has been awesome to use, thanks fholm. I'm excited for 1.3.

    I'm also having the problem with terrain tree collision. Terrain trees retain their prefab's layer and collider (always capsule) settings, so whatever fixes are coming for collisions will probably fix/affect them.
     
  33. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    Turns out this particular issue can be fixed by moving the bool allowMovement declaration to after the DoGravity() call, since the issue is caused by the fact that CurrentGround.IsTouching is false until after the DoGravity call. Moving the allowMovement declaration to just before the DoMove() call makes it so you can jump on the cube and not get stuck. Doesn't fix the other step problem though.

    It does though also expose another unusual problem. When jumping on the collider, if you don't start walking immediately after, you'll actually start sliding down it. As soon as you move though, you stop sliding. This is even if the slope is only ~30 degrees.

    Edit: Turns out the slope thing is fairly obvious, it's related to the sphere size. I can reduce the size of the spheres to fix it but it gets all funky if it goes too low.



    The other issue with the platform close to the ground is just that, that the platform is close to the ground. Oddly if I lower sphere size I drop through the platform onto the ground.

    Edit2: Here's a few other interesting edge cases!



    1. This one only happens because there is actually a walkable ground underneath the terrain (I put a plane to catch players that go into the water to make it look like they're swimming on the surface, but it also goes under the island). When the player is inside a collider (or a collider moves onto the player), everything is fine but once you jump, you get pushed down through the ground, which isn't good. If there is no walkable ground under, you'll get pushed up (which would probably be optimal behavior, or just ignore it might be an option too). Edit3: (Apparently I can't even reproduce the circumstances that created this. Hmm...)

    2. This is another unlikely one, but basically one collider pushes you onto another. In this case though, your 'ground' point goes into the collider, but you get held up by the spheres on top. This means you're stuck unless the collider moves. Lowering sphere size will make it so you don't get stuck, but you end up just falling through the collider.
     
    Last edited: Mar 19, 2012
  34. Jornaman

    Jornaman

    Guest

    Joined:
    Mar 11, 2012
    Posts:
    4
    hey,

    I really like the way this controller is making my game play feel. I have decided to go with uLink for my networking. But I can't get the controller to work with the uLink Example Project: Authoritative Server. I'm reading a lot of stuff on both Unity and uLinks site but I'm just not seeing a way to set it up so it will work. Any help or suggestions would be helpful.
     
  35. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Just wanted to leave a quick note that I have setup a list of all the bugs you have reported and 1.3 is well underway, expect it to land in a few days (probably sunday-monday)
     
  36. DiegoC

    DiegoC

    Joined:
    Jan 14, 2011
    Posts:
    36
    Hi again,
    The new versión include this, please?
    Thanks
     
  37. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    1.2 already includes this, it's described in the changes list on the asset store.
     
  38. BruwtForce

    BruwtForce

    Joined:
    Mar 17, 2012
    Posts:
    23
    This might be a bit of a noob question, but I can't seem to figure it out.

    Does anybody have any ideas how to prevent mouse click-through (specifically with left and right mouse button drag) if the mouse cursor starts over the top of a GUI element? For example, if I pressed a button which brings up the inventory screen (using the Unity GUI through OnGUI), and then left click dragged an item from one bag slot to the other within that window, how do I prevent that drag motion on the inventory window being sent through to the input controller? At the moment if I left click drag something in that GUI window the camera moves etc..
     
  39. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    You have to check every UI rectangle if the mouse is over it basically.
     
  40. BruwtForce

    BruwtForce

    Joined:
    Mar 17, 2012
    Posts:
    23
    Figured that; however, being new to Unity what I don't know is what code is need to prevent that mouse movement propagating down and being picked up by the input controller. I not even sure if the 'blocking code' needs to be within my GUI class, or within one of your RPG classes.

    I'm trying not to start altering your code right now, because a 1.3 update is meant to be in the pipeline. I did think about detecting the mouse press event within my GUI class, flagging a blocking variable, and then having the input controller check it's state accordingly; however, that means altering your code which I don't really want to do right now, and also seems rather inelegant.

    Any suggestions?
     
  41. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    If you have NGUI you can just check a collider because all ui elements in NGUI are actual game objects rendered by a seperate camera giving you extreme flexability
     
  42. BruwtForce

    BruwtForce

    Joined:
    Mar 17, 2012
    Posts:
    23
    I think I must be incredibly dense, because doesn't that leave me in the same situation? Regardless of whether my GUI class uses the Unity or nGUI system, how would you prevent the mouse drag from propagating down and being picked up by RPGInputController? I can't see anyway of doing this without modifying RPGInputController in some way shape or form.
     
  43. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    On a related note, 1.3 is pretty much done, it's a complete re-write and re-structuring of the motor and everything else, just finishing up the last pieces of the animation controller and hopefully pushing it to the asset store tomorrow. I gotta say it's a lot smoother and faster then any of the previous version, almost all of the "jittering" is gone, stairs work properly, mesh collision uses a lot less memory, well, a bunch of very nice changes :)

    I'll make sure to post a complete change log as soon as it's done, and anyone that wants it before it goes on the asset store (when it's done) can PM me their asset store invoice number and I will send back a link as soon as it's done.

    Edit:

    And it also comes with a written PDF manual with a lot of screenshots that explains everything in great detail :)
     
  44. artician

    artician

    Joined:
    Nov 27, 2009
    Posts:
    345
    Hello,

    I just picked this up today to shortcut some project work. However in a completely new project, in a new installation of Unity 3.5, it has compiler errors right away. Can you please help me with these issues?
    Primarily Unity has found errors in the script "ThirdPersonController", and will not allow any scenes to run within the project (not even the Demo scene is functioning) until they're fixed. The specific errors are:

    Assets/Standard Assets/Character Controllers/Sources/Scripts/ThirdPersonController.js(193,54): UCW0003: WARNING: Bitwise operation '|' on boolean values won't shortcut. Did you mean '||'?

    Assets/Demo/Assets/AnimationController.cs(81,36): error CS1061: Type `ThirdPersonController' does not contain a definition for `onJump' and no extension method `onJump' of type `ThirdPersonController' could be found (are you missing a using directive or an assembly reference?)

    Assets/Demo/Assets/AnimationController.cs(140,32): error CS1061: Type `ThirdPersonController' does not contain a definition for `Grounded' and no extension method `Grounded' of type `ThirdPersonController' could be found (are you missing a using directive or an assembly reference?)

    Assets/Demo/Assets/AnimationController.cs(162,32): error CS1061: Type `ThirdPersonController' does not contain a definition for `Grounded' and no extension method `Grounded' of type `ThirdPersonController' could be found (are you missing a using directive or an assembly reference?)

    I have most standard assets and scripts imported to this project. Are there any dependencies with Unity assets I'm not aware of? Any packages I should import other than your own?

    This looks like a nice tool, but I'm a bit disappointed that it failed upon import. ;)

    Many thanks in advance.
     
    Last edited: Mar 23, 2012
  45. BruwtForce

    BruwtForce

    Joined:
    Mar 17, 2012
    Posts:
    23
    You might want to watch these setup instruction videos:

    Part 1: http://www.youtube.com/watch?v=AUX9k7Xx2Vg&feature=youtu.be
    Part 2: http://www.youtube.com/watch?v=-r0Zmka4nSI&feature=youtu.be

    They were listed on the asset store, but you might have missed them. You don't need the ThirdPersonController as you will see!
     
  46. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Hey, the errors you are getting are not from my scripts as far as I can see, I don't mean to be unhelpful but all the scripts files you are linking seem to be referring to the "MMO Controller" demo that Unity Technology has built, as all my scripts have the prefix "RPG". Are you sure that you bought and imported the correct one? This is the link to the package: http://u3d.as/content/fholm/rpg-controller-camera/2Jh
     
  47. artician

    artician

    Joined:
    Nov 27, 2009
    Posts:
    345
    Bizarre! Confusing! I've never used that before. I will investigate.

    Thank you!
     
  48. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    It may also be referring to the third person controller scripts that come in the standard assets, but unless you have renamed all of my classes those are not my scripts giving you errors :)
     
  49. DiegoC

    DiegoC

    Joined:
    Jan 14, 2011
    Posts:
    36
    Thanks.
    But, How I use it, please?
    Where is the documentaition?
    Thanks in advance
     
  50. EarthLaunch

    EarthLaunch

    Joined:
    Mar 7, 2012
    Posts:
    62
    Wow, this sounds really awesome :) Can't wait.