Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] All in One Game Kit - ELC Character System

Discussion in 'Assets and Asset Store' started by GrantMarrs, Mar 19, 2016.

  1. ShinyTaco

    ShinyTaco

    Joined:
    Sep 4, 2012
    Posts:
    70
    Hi Grantrum,

    I picked this up about a week ago and have been using it for a project.

    However, something odd is happening. If I use the rigidbody ninja and I go higher than about 100 meters high, and walk, I get a lot of very bad vibrating/shaking with the ninja.

    In the inspector it shows that he is switching back and forth from being grounded and not.

    I'm not sure how to fix this, any ideas?

    Thanks.
     
  2. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Hmm, strange. This doesn't happen with the CharacterController. I'll update this post when I've found the fix for the Rigidbody :) Thanks!

    Update: I found the fix :) I had to change multiple sections of the script though, so explaining how to fix it would be very difficult. Don't worry though, I'm updating the asset package now, so the fix should be uploaded very soon (whenever it is approved) ;) Thanks again!
     
    Last edited: Nov 22, 2016
  3. ShinyTaco

    ShinyTaco

    Joined:
    Sep 4, 2012
    Posts:
    70
    Great!

    If I emailed you my invoice number, could I get the updated version? It's somewhat time critical.

    Also, just out of curiosity, could you explain why it was doing that?

    Thanks again!
     
  4. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Absolutely! Just send me the invoice number whenever you're ready, and I'll give you the updated version right away ;) (5-star ratings as proof of purchase are also appreciated :p)

    Sure! Basically, what was happening is that I was subtracting the Rigidbody's current y-position from his movement direction (in order to keep him on the ground, since Rigidbodies tend to lift up or bounce off the ground for some reason), but the higher the Rigidbody's y-position is, the higher the value that has to be subtracted from the movement direction. This made the player shake because he was basically trying to push through the floor (since it was subtracting such a high number from his movement's y-value). To fix this, I changed multiple parts of the script to only subtract the player's y-position if he is not absolutely grounded :) Thanks again!
     
  5. ShinyTaco

    ShinyTaco

    Joined:
    Sep 4, 2012
    Posts:
    70
    Awesome, thanks!

    I've sent through my invoice number.

    Thanks for the explanation. I found it very odd that it would happen when the ninja was placed higher up.

    Keep up the good work!
     
  6. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Lol, yeah, I thought it was odd too. It took me all morning to find, but I finally got it fixed :)

    If you need any more help, please don't hesitate to ask! :D Thanks again!
     
  7. Shinodan360

    Shinodan360

    Joined:
    Mar 21, 2015
    Posts:
    7
    Hi there, Been working with your asset a few days and im so exited to see what ill be able to build with it.\

    Im stuck in my current project though as i cant for the life of me figure out how to get virtual joysticks working
    with it, is there any easy way to do this, im a playmaker user so cant code very well :/
     
  8. Shinodan360

    Shinodan360

    Joined:
    Mar 21, 2015
    Posts:
    7
     
  9. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    I'm very sorry, but I'm not sure I know how to help with this :( Getting mobile controls and virtual joysticks to work in Unity has always been really tricky for me, and I've never used playmaker before, so getting them to work in playmaker would be completely new to me :/ I'm really sorry again. I hope you can find the answer soon, but if you need help with anything else, please don't hesitate to ask :) Thank you!
     
    Last edited: Nov 29, 2016
  10. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    But, does it have hollow bottom platforms?
     
  11. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Hello, thank you for your question! It does kind of work with hollow bottom platforms :confused: However, you would need to child your platform to a quad or plane with a mesh collider (since quads and planes are one-sided), set the plane/quad's tag to your platform tag, disable its mesh renderer (so it cannot be seen), then remove the original platform's collider. That way, the player will only collide with the one sided plane/quad, allowing him to jump through the bottom (although he might be shaky going through).

    There are lots of cleaner ways to do this through scripting (whether by using layers, trigger colliders, disabling/enabling colliders, etc.) that may or may not work for everyone, so I did not include an automatic way of doing this (since it might not work for everyone's situation). However, anyone with a little bit of programming knowledge could easily implement this themselves with just a little bit of scripting :) Thanks again!
     
    Last edited: Nov 29, 2016
  12. Shinodan360

    Shinodan360

    Joined:
    Mar 21, 2015
    Posts:
    7
    Okay no problems thanks for the reply, I got everything else to work just this one problem, take nothing away from the asset, it is absolutely amazing, i would never be able to make what im working on just now without it!

    So thank you for making such a great asset at such a reasonable price!
     
  13. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Thank you so much, and no problem! :) I'm glad you enjoy it :D
     
  14. erich202

    erich202

    Joined:
    Sep 24, 2016
    Posts:
    38
    Hey there!
    Really nice looking asset so far.
    Hoping you can help with some trouble I'm having where the character from the default scene is stuck jumping on my terrain. I'm using the character controller scene + my scene. The "grounded" flag is getting checked/unchecked. If I increase the height/distance/radius to 2, he'll mostly stop but when running sometimes randomly jumps, and jumps pretty high. I don't think he's really jumping, he's just.. getting ungrounded. Do you have any ideas of things I can try? It seems like it's mostly on uneven surfaces.
    PS. The rigidbody one could barely move on the terrain, kept getting stuck.
    Happy holidays,
    Eric
    Edit: I think I figured it out. Seems to be happening when the character is below surface. I moved the terrain above 0 and it seemed to work. Uploading video...
     
    Last edited: Dec 21, 2016
  15. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Hmm, that's strange. When I lower the stage in my demo scene, my character doesn't seem to bounce at all. Try enabling the "Hard Stick To Ground" option in the Player Controller's "Movement" section. This makes sure that the player sticks to the ground (specifically in situations like this one) whenever there is ground under him. :) Thanks!
     
  16. erich202

    erich202

    Joined:
    Sep 24, 2016
    Posts:
    38
    Hi Grantrum, thanks for the reply!
    Unfortunately that doesn't seem to do anything. Also I do want to be able to jump. Definitely moving the terrain is the fix, for this particular terrain. It was fine for self-created terrain. This came from some asset on the store.
    Here's the video btw:

    Eric
     
  17. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Interesting. I was able to reproduce the bouncing result by lowering my stage by 70 and changing its rotation. I will tell you when I have found the fix :)
     
    erich202 likes this.
  18. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Okay Eric! I believe I fixed it :D It works right in my scene, so it should work in yours as well. I'll send you a PM with the revised code.
    Also, I'm updating the asset package now in case anybody else has this problem. The fixed version should be uploaded on the asset store very soon (whenever it is approved) ;) Thanks again!
     
    Last edited: Dec 23, 2016
    Bhanshee00 likes this.
  19. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    I also added a standalone version of the ladder and wall climbing script, as well as a standalone version of the moving platform script, to the asset for anybody who wants them. They are the same as the ladder/wall climbing and moving platform categories from the player script, only they are in their own standalone scripts (so you can use them with any player script, not just the one from this asset) :) These will be available for download whenever the asset is re-approved as well.
     
    zenGarden and Bhanshee00 like this.
  20. Namke

    Namke

    Joined:
    Mar 21, 2013
    Posts:
    6
    Hello
    I just import freshly ELC, and these bug happen with scrolling version:
    • With character controller
      • Character stuck randomly under low platform
      • Character jump out of plane, then stuck
    • With ridgidbody
      • Character couldn't move on stairstep?
      • Character jump out of plane, then stuck, like character controller version
      • Character couldn't climb ladded
      • Character couldn't move up on 45 degrees platform?
    Is this a bug or intentional, because I don't see these issues seem to happen with demonstration in web? In document there are no instruction for newly imported project so I guess it is just imported and run, and it should work?
    Mine use Unity v5.5p, Windows, issues happen same in Mac. Please check videos below

     
  21. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Hi Namke! That's very strange that the character is getting stuck at that one spot for you. I have never seen that happen before. It does not happen at all in my version of Unity (which is probably why it does not happen in the web demo). Try raising the platform above his head, maybe it is too low and he is getting stuck under the collider.
    As for the Rigidbody not walking up the stairs, Rigidbodies can't do that. Check this thread for proof: https://forum.unity3d.com/threads/h...-player-to-walk-on-any-type-of-stairs.133573/
    The only way to make a Rigidbody walk up stairs is by putting an invisible collider there as a ramp. That is why the Character Controller can walk up stairs in my demo, but the Rigidbody cannot. This bug has nothing to do with my asset. In fact, I did actually put invisible ramps there for the Rigidbody, but I must have forgotten to save them, lol.
    I'm not sure what you mean when you say that your character could not climb ladders. It seems like you were able to climb a ladder every time you went on one in your videos. (edit: I see what you mean at 4:21. I've already uploaded an update to fix it. It should be approved very soon.) :)
    This is intentional. The character has an angle limit of 25 degrees in the demo. If you would like to increase that limit, all you would need to do is increase the "Slope Limit" option of the PlayerController.

    None of these problems are actual bugs in my asset though. If you would like, I can reposition the colliders for you, and send you the demo scenes with them repositioned (so that everything works right) :) You should have asked me for help (like you are doing now) before you left a one-star review. That is not a good way to get my attention. I am always willing to help everyone who has problems with or questions about my asset. If I completely fix these problems for you (which I always do for my customers), you must agree to remove your review first. I'm not going to spend all day downloading a different version of Unity to test, and try and fix these, then readjust colliders, for a one-star review.
     
    Last edited: Dec 27, 2016
  22. Namke

    Namke

    Joined:
    Mar 21, 2013
    Posts:
    6
    Hello,
    Can you tried to reproduce in your side, with Unity 5.5p? Saying that not happening in your side (even it is a fact) pretty much doesn't help, and adjusting level until it doesn't happen is not a solution as well I think, if project being incompatible with recent version of Unity (I've seen you publish with version 5.0), it should be considered an issues and should be fix.
    Common sense is straight forward, I do expect just imported fresh project, and it should work as it, exactly like demonstration, so I can move forward later on. I don't think "asset that works perfectly fine" will contain similar issues.

    • Character couldn't move on stair step with rigidbody sound acceptable, however is there are any workaround that? I actual preferred ridgidbody over character control.
    • Character couldn't climb ladder -> see first video from 4:25
    • Character couldn't move up on 45 degrees platform? -> in your webGL demo it could, so that build use different setting than release package? Or just a limitation of rigidbody version please? Anyway you should state or publish rigid version somewhere for future client to check next time, with these ridiculous limit, support rigidbody pretty much worthless.
    For me these are bugs, as it not working like demonstration, or being hidden from demonstration. And honestly, I'm not here to discuss what is a bugs.

    Asking for remove review first is not a customer oriented attitude, and let agreed to disagreed, I still keep my review for your current release that itself buggy, because it is. Let see your next (quickly) updated version can eliminate these problem or not, then I will update my review.
     
  23. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    The bugs you mention do not happen in earlier versions of Unity, so I will download Unity 5.5 to attempt to fix them :) Telling me to fix them "quickly" will not help though. Fixing and figuring out how to fix glitches can take a lot of hard work and time. You are also asking me to fix Unity's limitations of the Rigidbody, which is impossible for me or anyone who is not Unity themselves. I'm sorry. If Unity were to "fix" the Rigidbody like you say, it would just become the Character Controller. If my Rigidbody support is "worthless" because of Unity's limitations, then, by that logic, Rigidbody support in every asset ever is worthless as well. I will try my best to find a work around for it though. Also, you say that I am not customer-oriented. However, I always try to be very accommodating to my customers who are at least a little considerate to me when asking for help, but leaving a one-star review without asking for my help, then telling me to fix these problems quickly (even though some of them are impossible for anyone to fix) is not considerate. If you are publisher-oriented, then I will be customer-oriented back, but I have no desire to spend all day, or multiple days, fixing problems that can and cannot be fixed (such as Unity's Rigidbody limitations) for a customer who does not realize the difficulties and limitations of programming, so he is inconsiderate to and demanding of me. You will probably think that this does not matter, and that I am the one being inconsiderate and should fix it, but if you had to spend 30+ hours of hard work for 70% of $29.99 and a customer who is not being polite to you at all, you would feel differently. I will try my best to fix these problems, but please just remember that a little politeness can get you a long way. Thank you, and Merry Christmas :)

    UPDATE: Okay, I just fixed the stuck problems from Unity 5.5, and did what I could to the Rigidbody for you ;) I also changed the player's slope limit, so he can run up 45 degree angles for you now :D I will send you the revised files now. I'm also uploading the fixed version to the asset store right now, so it should be available on the asset store whenever it is approved. Thanks again!
     
    Last edited: Dec 27, 2016
  24. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192

    Hello everyone! Merry Christmas! I know a lot of you have been asking me for this certain feature, so I thought today would be a good day to show it :) I hope you all like it! :p
    It's still a WIP, but I am trying my best to get it out as fast as I can for you guys :D
    I also wanted to say thank you all for such a great year. It has been such pleasure to work with all of you, and I cannot thank you enough for all of your support and belief in my asset. It really means a lot to me :) Thank you so much again, and Merry Christmas and Happy Holidays to all of you!
     
    Bhanshee00 likes this.
  25. Namke

    Namke

    Joined:
    Mar 21, 2013
    Posts:
    6
    Perfect, I'm waiting for updated version and then update review in my side.
    Merry Christmas and Happy New Year!
     
  26. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Thank you Namke :) Merry Christmas and Happy New Year to you as well!
    By the way, I sent the updated files to your inbox in case you wanted to download them now ;)

    Edit: The updates have been approved! :D
     
    Last edited: Jan 16, 2017
  27. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    Are projectile attacks something that would be easy to implement?
     
  28. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Hello, thank you for the question! :)
    The actual programming/scripting for projectile attacks wouldn't be too difficult to implement, but since I would also need to model and texture the projectiles (and possibly make particle effects for them), make "projectile-throwing" animations for the player, and keep the projectile throwing separate from, but not interfere with the player's other actions (actually, this part would be difficult to script, lol), it would still take a long time to implement.
    Currently, I'm working on adding swimming to the asset, but projectile attacks are a great suggestion, and I will definitely keep them in mind for later. ;)
    Thanks again!
     
  29. popandersson

    popandersson

    Joined:
    Oct 15, 2015
    Posts:
    6
    Hello Grantum

    I made some improvement(I think) to preventing mouseEvent go through UI, plus that you can avoid it from reaching
    gameObjects with certain tags.


    Here is the code that goes in to PlayerController:

    bool AvoidMouse() {
    if (tagsAvoidingMouseAction == null)
    return false;

    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    RaycastHit hit;
    if (Physics.Raycast(ray, out hit))
    {
    foreach (string script in tagsAvoidingMouseAction) {
    if (hit.collider.gameObject.CompareTag (script)) {
    return true;
    }
    }
    }
    return false;
    }


    // Update is called once per frame
    void Update () {
    if (EventSystem.current.IsPointerOverGameObject () || AvoidMouse()) {
    return;
    }
    ...


    void FixedUpdate () {
    if (EventSystem.current.IsPointerOverGameObject () || AvoidMouse()) {
    return;
    }
    ...


    cheers
     
  30. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Awesome work! :) Thanks a lot man :D
     
    Bocop likes this.
  31. Bocop

    Bocop

    Joined:
    Feb 1, 2017
    Posts:
    7
    Hey there! I am thinking about getting this but it has been like 1-2 versions since I have messed with Unity. I am thinking about making a 3D platform game with some Metroidvania and Mario 64 elements in it. Would this work? Also, powerups, can I make it so for example, the Ninja dude finds Rocket boots and can hover? Or finds a Mega Man blaster and can shoot stuff? Thanks and any help would be appreciated!
     
  32. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Hello! Thank you for your interest in my asset :)
    It definitely could work for a Metroidvania or Super Mario 64-like game. I actually based a lot of the elements in the asset off of Super Mario 64 (such as the combo jumps) ;)
    As for the powerups, my asset does not come with any by default, but as long as you know how to script, adding them shouldn't be too much of a problem. Most of the features in my asset's scripts are in separate functions, and are called from the Update or FixedUpdate functions. So disabling a certain feature while using a powerup (so that the feature does not interfere with the added powerup) should not be too difficult :) For example, if you were to add rocket boots, you could make it so that when the player is wearing them, his regular movement is disabled (by putting an if statement around whatever movement function you are trying to disable, that is called from the Update or FixedUpdate function).
    I hope this helps! Thanks again :D
     
  33. Bocop

    Bocop

    Joined:
    Feb 1, 2017
    Posts:
    7

    Wow, that is some great info, I may have more questions as I go along. Also, I am going to be using my own rigged dude who will be a caveman who headbutts people, will I be able to use that animation to work with the "punch" that works in your engine? I am a Unity newb and honestly have not touched it since 3.0-4 and forget a ton of stuff!

    also, he will have a large head and climb with his MOUTH... will that be possible to work with your engine?

    Also, if my char. gets Rocket boots, - then can I make it so there is a way for the character to fly around the level? Thanks! - Joe
     
  34. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Yes to all of that! :)
    To change the player's animations, all you would need to do is open up the player's animator controller, and swap the animations there for your own.
    As for the rocket boots, they're very possible to add as long as you know how to script them in. Like I said before, disabling the other movement features of the asset (to allow for the rocket boots' flying) should not be too difficult. So as long as you know how to script flying, you could definitely add them in :D
    Thanks again!
     
  35. Bocop

    Bocop

    Joined:
    Feb 1, 2017
    Posts:
    7
    I bought it! So far, I really like it! It does in fact feel very Mario 64! Now, questions! Can I make it so that jumping on someones head is the way I attack instead of Ninja moves? Also, can I make it so that the headbutt attack pushes back the enemy? If you have ever played Bonk, when he headbutt's a bad guy, there is a satisfying sound and the enemy sorta blasts backwards stunned. Then you can follow up another hit usually, is there a way to do this?

    I am so rusty with Unity I will have a lot of dumb questions, I apologize now. Also, would it be possible for the charactor to climb a flag pole that is horizontal and then spin around it .

    Also, can I make destructable blocks like mario bricks in this engine? thanks! - joe
     
  36. elijahrockshout

    elijahrockshout

    Joined:
    Apr 6, 2013
    Posts:
    14
    I haven't purchased just yet, but will soon, also just wanted to know how difficult is it to add these 3 things...
    1) a jump onto enemies to kill them attack (like Bocop asked)
    2) a ground pound or butt stomp (where you jump into the air and then press a button to smash down into the ground from the air)
    3) a 360 spin attack, where you can either stand still or move and do the attack (like crash bandicoot)

    Thanks!
     
    Bocop likes this.
  37. Bocop

    Bocop

    Joined:
    Feb 1, 2017
    Posts:
    7

    Yes, the butt stomp attack would be really great as well, I could use that technically for my head butt animation... Right?

    Also, I need help adding another controller package to this one, is that possible? there is a free 3rd person fly package that I love the flying part of it, would I be able to make it so that that package for the flight is active when my charactor "finds rocket boots"
     
  38. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Thank you guys for your interest, and thank you for purchasing it! :D
    As long as you know how to script those features, adding any of them to the script shouldn't be that hard :) They would just take time.
    Also, I'm working on adding swimming right now (which is taking up all of my scripting time), so I can't add anything else to my script at the moment :( If you guys know how to script your features, they shouldn't be too difficult to add though, they would just take time :)

    In the EnemyAI script, there's an option named "Knock Back Factor," so if you wanted to change how far a certain enemy gets knocked back every time they get hit, that would change that. However, if you wanted to push an enemy back more for certain attacks, and less for others, you would need to edit the EnemyAI script.
    You could do this by using GetComponent to get the player's "currentAttackNumber" (from his PlayerController scipt), and changing the enemy's Knock Back Factor (known in script as "damage.knockBackFactor") based on the "currentAttackNumber" (this number represents which attack the player is currently using from his attack combo) :)

    Thanks again!
     
    Last edited: Feb 3, 2017
  39. Bocop

    Bocop

    Joined:
    Feb 1, 2017
    Posts:
    7

    Thanks for the response! I guess I can try to figure it out, I read alot about putting a collision point on the heads of the enemies, or putting it on the top of my characters head, but I only want it to work if my character is in the animation... because I do not want to be able to walk around and fall on enemies and stuff like that.
     
  40. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    No problem! :) To make the player only jump on enemies when he is in a certain animation, you could use something like this:

    animator = GetComponent<Animator>();
    if (animator.GetCurrentAnimatorStateInfo(0).IsName("Your animation name here")) {
    //allow jumping on enemies
    }
     
    Bocop likes this.
  41. Bocop

    Bocop

    Joined:
    Feb 1, 2017
    Posts:
    7
    Wow, fantastic. thanks again! I might hit you up on Gmail because I am clogging up your support site here!! haha!!!
     
  42. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Haha, no problem :)
     
  43. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    Hi Grantrum,

    I was trying to decide whether to play with your kit or AGS first. I need projectiles and swimming (ultimately) which AGS supports but I get a better vibe off your video and demo (which works very well). I'm happy to hear you are working on swimming and plan to add projectiles so I'll take the plunge. Keep up the good work.
     
  44. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Thank you so much! :D
    Swimming is coming along really nicely. I just need to add a few more options and touch things up, and it shoud be finished soon ;)
    Thanks again!
     
  45. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    After playing around with the demo scenes and glancing over the code for a bit, first off — great job, I love the fact that almost everything you've done just works organically rather than requiring huge amounts of fakery (e.g. all the ledge climbing stuff "just works", and if you add labels to things they gain appropriate behaviors, etc.), but I have a few questions:

    Is there a reason you're doing so much work on Update()? Seems to me almost everything that's happening in Update() could be in FixedUpdate(). You might find things work better with rigidbodies too.

    I'd like to work with rigidbody controllers (I'd like to use "faux gravity" to let the character walk around on the surfaces of spheres, and so on) but right now the behavior is pretty unacceptable — elevators cause horrible stuttering in the animation (which actually sometimes occurs with both controllers, but it's much more frequent with the rigidbody controller).

    One annoying behavior (and you're hardly alone in this, I've seen similar issues in shipping AAA titles such as Elder Scrolls Online — where you can get glued to the sides of buildings and steep hillsides and find yourself falling in slow motion for what seems like hours — and the latest Ratchet & Clank) is that the character gets quasi-stuck to surfaces and slides down slowly in lots of common edge cases. If you can figure out how to not do that it would be great.

    Oh yeah and the jumping behavior is very weird — is that intentional?
     
  46. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    I find the third person camera behavior to be annoying. I think it should slowly snap to being behind the player by default but it's often quite hard to get it behind the player at all. Obviously, one can just write one's own camera controller but given that the included controller is tightly tied to things like climbing…

    Unrelated bug: Not sure whether this is your bug or inherited from a script you modified, but the CameraController contains a function called ClampAngle which is just wrong.

    It forces the input angle between -360F and 360F and then clamps it between minimum and maximum. This is just terrible. (E.g. -180F is the same angle as 180F but isn't going to be inside the same intervals, so ClampAngle(180, 0, 360) => 180, but ClampAngle(-180, 0, 360) => 0.

    You'd be better off just using plain old clamp!

    Again: the camera controller is doing work in Update() that should be in FixedUpdate().

    Stuff like picking targets could probably be throttled down even further and put in a coroutine.
     
  47. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Wow, thank you for all the advice! :)
    So calling functions from a Coroutine, instead of Update or FixedUpdate would improve the overall performance? I actually thought they were the same performance-wise since the functions were still being called separately (instead of everything being scripted in the same function). :confused:
    By the way, the camera actually can snap behind the player faster. All you need to do is decrease the CameraController's "Rotation Dampening" in the "Following" section :)
    Thanks again! :D
     
  48. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    I tried decreasing damping and it doesn't help much. Try setting it to zero and simply walking to the left or right.

    As for any advice on performance…

    First off: use the profiler and find out where your bottlenecks are. Everything else is secondary.

    But:

    OnGUI, Update -> called every frame. In general, things concerned purely with appearances that don't rely on the positions of things should go here.
    FixedUpdate -> called every physics update (usually 30fps — you set this). In general, things that care about and/or change where things are, which direction they're going, and whether they're colliding in should be in here.
    Coroutine -> you can tell it how long to sleep for (e.g. for an enemy AI you can go to sleep for 1s if the player is far away, and so on; if the AI is a state machine you probably don't want to change states very often so it can be deeply throttled. If you consider your target picking code, you don't even want that to thrash (e.g. switching between two similarly distant targets quickly) so you could stick that code in a coroutine and have it only fire a few times per second.

    The way FixedUpdate works is very interesting. E.g. if you're trying to move something based on Time.deltaTime inside FixedUpdate it works exactly like Update — you don't need to care that the deltaTime will be larger (hopefully!) inside a FixedUpdate than inside an Update.

    The beauty of coroutines is that they don't need to fire during FixedUpdate (which is when things get busiest).
     
    Last edited: Feb 6, 2017
  49. GrantMarrs

    GrantMarrs

    Joined:
    Mar 29, 2015
    Posts:
    192
    Awesome, thanks for the guide man! :)
    Also, I see what you mean for the camera rotation. I based it off of the Legend of Zelda: the Windwaker's camera, so it's meant to be like that actually. This might be more what you're looking for though (just follow these steps):

    1. Replace the if statement at line 613 with this:
    Code (CSharp):
    1. if (directionVector.magnitude > 0.2f && Mathf.Abs(Input.GetAxis("Horizontal")) >= 0.01f){
    2.              
    3.                 lookDir = Vector3.Slerp(lookDir, -playerForward, (1/follow.rotationDampening) * Time.deltaTime);
    4.              
    5.             }

    2. Replace the code in line 636 with this:
    Code (CSharp):
    1. playerPos = playerOffset + player.transform.up * follow.cameraHeight - lookDir * cameraDistance;

    I hope this helps, and thanks again!
     
  50. tomraegan

    tomraegan

    Joined:
    Mar 28, 2016
    Posts:
    137
    Hi Grantrum.

    I'm trying to improve the predictability of letting go of a ledge. I am still using an old version of your asset, so this may have been addressed.

    Once I've grabbed on, I'd like a single click to release me without more than a momentary delay. Currently I've got to wait a second or two before a single click release and I'd like that to be more immediate. Is that possible?

    Secondly, if I wait for 3 seconds just grabbing on, the running animation kicks in. This requires a double click to allow a fall and does not always result in a fall. I can, of course, stand up again, but it's not what I'm after.

    This may well have been addressed in the latter releases.

    Love your work!