Search Unity

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v8.0 : advanced damage system]

Discussion in 'Assets and Asset Store' started by reuno, Dec 18, 2014.

  1. Marcsairu

    Marcsairu

    Joined:
    Feb 7, 2018
    Posts:
    9
    this.gameObject.GetComponent<MoreMountains.CorgiEngine.Character>().MovementState.ChangeState(CharacterStates.MovementStates.Idle);

    The code above is the one I'm using but it doesn't force the character to be in an idle state. It does nothing. Thanks for replying.

    Nevermind I got it. It works now. Thanks!
     
    Last edited: Aug 15, 2021
    reuno likes this.
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Marcsairu > Glad you figured it out. Without details it's hard to tell what your issue may have been. My 1st guess would be some other ability was setting a different state.
     
  3. Marcsairu

    Marcsairu

    Joined:
    Feb 7, 2018
    Posts:
    9


    Thanks! Anyway I think this is not supposed to happen in character switch feature.

    1) Rectangle Char jump and I suddenly changed characters after pressing jump. When I went back to Rectangle Char the jump continued.
    2) Much weirder, when I use the dash characters in other characters then switched, the next characters float and started making weird behaviors.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Marcsairu > If you think you've found bugs, please use the support form to report them, and make sure you provide the context info requested right next to it, thanks.
     
    Marcsairu likes this.
  5. PainlesslyBasic

    PainlesslyBasic

    Joined:
    Aug 11, 2021
    Posts:
    2
    So, I've been looking into using the Corgi engine and I must say that everything is working nicely from what I've been able to test out. However, there is a problem that has recently cropped up concerning the character's dash ability. I haven't really touched the character dash script much, but now for some odd reason, whenever I press the dash button, my character just stays put. I can still move the character left and right, but nothing else. When I have traveled the length of what the dash distance should be then I have full control over the character again. Oddly enough, when dashing in the air, the character just hangs in the air until, once again, the distance of what the dash should be has been traveled (so it's pretty much the same thing as if they are grounded). Any idea what could be causing this?

    Edit: I have found the issue, it's because I had Instant Acceleration enabled for my movement. Is there a possible way that I could be able to dash and have instant acceleration enabled?
     
    Last edited: Aug 17, 2021
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @PainlesslyBasic : no idea,no. Does the issue happen in any of the demo scenes? If yes, where?
     
  7. PainlesslyBasic

    PainlesslyBasic

    Joined:
    Aug 11, 2021
    Posts:
    2
    @reuno I have found the issue. It was because I had instant acceleration set to true. Turn it off and the dash works as normal. Though now I have to find a way to get both of them working together without one affecting the other.
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @PainlesslyBasic > I suppose you may have made other changes. If the issue persists, don't hesitate to send me repro steps to your issue, from any of the demos, via the support form. It's a bit hard to tell what you may have done without such steps.

    In the meantime, I'd recommend trying the following, in a fresh install of the engine :
    - open the MinimalLevel demo scene
    - select the Rectangle prefab, set InstantAcceleration to true on its CharacterHorizontalMovement component
    - press play, dash, notice it works just fine
     
  9. balex499

    balex499

    Joined:
    May 21, 2019
    Posts:
    1
    Hello, how to realise ice surface in corgi?
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  11. RobbieLiverpool

    RobbieLiverpool

    Joined:
    Aug 1, 2019
    Posts:
    6
    Hi, I'm using the retrovania level with the retrocorgi character as a template and have come across an issue - I'm not sure of the exact cause so I'll describe it as I have set up:

    I have a one-way platform near the top of the screen with a ladder that goes off the top of the screen. I have set up a room transition so that going near the top of the ladder will transition to the room above, where I have continued the ladder - so going down will transition back to the room below.

    The transitions work fine, but when I climb back down the ladder and back onto the one-way platform, when walking off the platform, my player will continue to walk in mid-air, as if it hasnt detected that I have left the platform. The only way to rectify this is to walk back to the one-way platform and jump or climb the ladder again slightly, which will put the player into the correct state.

    Hope that description makes sense - any ideas what could be causing this?
     
    Last edited: Aug 19, 2021
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @RobbieLiverpool > Would you happen to have FreezeCharacter checked maybe? There's a bug where Unfreeze doesn't necessarily restore the proper state, it's fixed for the next update though (don't hesitate to drop me a line via the support form if you want the fix). In the meantime I believe unchecking FreezeCharacter on your teleporter should solve your issue.
     
    RobbieLiverpool likes this.
  13. RobbieLiverpool

    RobbieLiverpool

    Joined:
    Aug 1, 2019
    Posts:
    6
    That fixed it. Thanks. I should be okay waiting for the fix until the next update, I'll submit a form if I need it sooner. Thank you.
     
    reuno likes this.
  14. Nelmarticus

    Nelmarticus

    Joined:
    Feb 10, 2021
    Posts:
    5
    I am having an issue with Melee Weapons, and triggering the attack animation. My character is Sprite Based. I have the Animator, Sprite renderer, and Character Scripts laid out and Bound appropriately (all other animations trigger fine), and I followed the Information on the Documentation Page for binding the Animator to the Character Script. I have a duplicate of the RetroMeleeSword prefab attached as my initial weapon. When my character spawns, the sword shows up in the inspector, and I can attack and hit enemies, but no animation plays.... However, is I nest the Prefab inside my Character Prefab, bind the animator to my Model, and trigger the animation through a FeedBack, it triggers fine. But as soon as I remove the nested prefab from my character, I loose the binding, and it goes back to not playing the animation.
    I looked in the Inspector in Debug mode, and Handle Weapon shows my characters animator is bound correctly, but when I watch the Animator Controller and trigger an attack, nothing is updated. I've tried with both a trigger and Bool, and have ensured that the parameter name is spelled the same.
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  16. LorenzoSampietro

    LorenzoSampietro

    Joined:
    Jun 28, 2017
    Posts:
    20
    Good afternoon,

    I have an "invincible player". Every enemy thank touch the player take a damage and gets a know back.

    On the enemy prefab I added "Damage on touch" script.
    All works fine: when the plays touch the enemy this one "jump" cause by know back.

    If I set "Damage taken every time" the knock back (force) stop working.

    It's normal?

    In screen shot my setting.
    thank you
     

    Attached Files:

  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @LorenzoSampietro > You don't seem to have set any DamageTakenEveryTime on that screenshot, it's zero.
    And yes you can combine the two, and can easily test it if you follow these steps :
    - fresh install of Corgi Engine v7.2.1 on Unity 2019.4.29f1
    - open the MinimalLevel demo scene
    - drag a Blob prefab in the scene, position it at 0,-4.5,0
    - on its DamageOnTouch component, set DamageTakenEveryTime to 1
    - press play, on contact with the player, the enemy will apply damage to the player and push it back, and will take 1 damage itself
     
  18. LorenzoSampietro

    LorenzoSampietro

    Joined:
    Jun 28, 2017
    Posts:
    20
    Hi, yes, it's zero in this screen shot....and it works.
    If I set value to 1 or more no know back occurs...
    Any way I follow your suggestion
     
  19. LorenzoSampietro

    LorenzoSampietro

    Joined:
    Jun 28, 2017
    Posts:
    20
    Hi,

    I tried with "Minimal level".
    Added this prefab: "RetroBlobWaitJumpWalk"

    If I set "Damage taken Every Time" != 0 the knockback still not work.

    ps:
    unity 2021.1.17f1
    corgi: v7.2.1
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @LorenzoSampietro > Ok, not sure why you wouldn't just follow the steps I wrote, but why not. Just tried this :
    - fresh install of Corgi Engine v7.2.1 on Unity 2019.4.29f1
    - open the MinimalLevel demo scene
    - drag a RetroBlobWaitJumpWalk prefab in the scene, position it at 0,-4.5,0
    - on its DamageOnTouch component, set DamageTakenEveryTime to 1
    - press play, on contact with the player, the enemy will apply damage to the player and push it back, and will take 1 damage itself
     
  21. LorenzoSampietro

    LorenzoSampietro

    Joined:
    Jun 28, 2017
    Posts:
    20
    Reproduced and the result it's the same.

    If "DamageOnTouch" = 0 the knockback works.
    if it's != 0 no know back

    If you want I can send the project file
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @LorenzoSampietro > No need to send a project file. Maybe try reproducing my (exact) steps in a fresh install. If the issue persists, please use the support form, thanks.
     
    LorenzoSampietro likes this.
  23. Nelmarticus

    Nelmarticus

    Joined:
    Feb 10, 2021
    Posts:
    5
    Quoting the Documentation on the website

    "
    I’ve setup an animation and when I dash/attack/jump it doesn’t play
    This is a very common question, Unity’s animator can be a bit tricky sometimes. What’s very likely happening is that another transition is interrupting the transition you expect to be active at that point in time. A first thing to check is to make sure the engine is doing its job correctly, and updating parameters as it should.
    To do that, you can select your animator at runtime, in check the animator’s parameters. Do they update as expected when you perform your action? If yes, then the engine is updating these values correctly, and there’s likely an issue with your transitions."
    -- This is not happening, I have checked the Animator Controller During RunTime.


    "If not, maybe you didn’t bind your animator to your Character component correctly. If paramters are updating correctly, look at what transition is playing instead of the one you’d expect. You’ll want to make sure no other transition than the one you’re after can play. This can be ensured by specifying enough conditions in your transitions, using sub states, or making sure your state machine paths are constrained enough."
    --- I have double checked to ensure that the Animator is Attached to the Character. My parameters are set up correctly. I have spent two days trying to, please, if you can offer more help than "Dont use feedbacks for animations." and on how to solve this issue. I would really appreciate it, I have expended the Documentation, I have Watched You Tube... I can get Projectuile weapons working, but melee weapons are not working.
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Nelmarticus > I did offer more help than that though. You mentioned you were using feedbacks to play your animation on your weapon, that's not going to work unless you manually redo a binding between your feedback and your character. Both weapons and characters get instantiated, there can't be a link between them unless you have a script do it. That's over complicated, that's why it's usually not recommended to do it this way, and that's why I suggest changing that first. You can use feedbacks on weapons of course, just not to play animations on your character, there are easier ways.

    Instead, as explained in the docs, ( https://corgi-engine-docs.moremountains.com/animations.html#weapon-animation-parameters ), weapons come with built-in animation support, it's best to use that system instead of feedbacks. Have you given using these animation parameters slots a try? If yes, and if that doesn't work, could you send me repro steps via the support form ( https://corgi-engine.moremountains.com/corgi-engine-contact ) of how you create your weapon?
     
    Last edited: Aug 23, 2021
  25. Nelmarticus

    Nelmarticus

    Joined:
    Feb 10, 2021
    Posts:
    5
    I apologize if I came across as rude, not my intent, my frustration got the better of me. I have tried using the Animator Parameter Initializer, on the same layer as my Animator. I have Attached the Animator to the Character script, and I added the Start Use Parameter from the melee weapon to my animator, manually, as the Initializer did not add "MeleeAttack" to the parameter list.

    I have also tried a different approach, which was to copy and paste the animator references from the Classes into my parameters list, to ensure I am using the appropriate parameters for the abilities, I have chosen, Also adding the Start Use parameter from the melee weapon to my animator. The only way I have successfully triggered the animation with either of these set up, is by utilizing the Feedback, which I dont want to do, because that would negate any sort of weapon switching...

    I will reach out on the support form. Thank you for the reply.

    Edit: Form Submitted with the steps to the best of my ability to explain. :)
     
    Last edited: Aug 23, 2021
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Nelmarticus > The "normal" workflow (there are of course more options) would be to create a MeleeWeapon, in its StartAnimationParameter field, set something like "MyMelee". Then, in your character's animator, add a MyMelee bool parameter. Then, in your game, equip your weapon, observe your animator at runtime, the MyMelee parameter will turn true every time you attack. It's then just a matter of using that parameter in your transitions to play attack animations. You'll find examples of that in the engine, the RetroComboSword for example (pickable in RetroAI) is an advanced example of that, with 3 melee weapons rolled into one combo weapon.
     
  27. enyevg

    enyevg

    Joined:
    Oct 16, 2018
    Posts:
    5
    Hello, how to create materials with spritesheet animations like this in demos?
     

    Attached Files:

    • 2.JPG
      2.JPG
      File size:
      169.8 KB
      Views:
      292
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @enyevg > There are plenty of ways to do so, most of the time I use Photoshop or Aseprite, but plenty of other softwares out there will let you create animations and export them to spritesheets.
     
  29. enyevg

    enyevg

    Joined:
    Oct 16, 2018
    Posts:
    5
    Oh, you misunderstood me. But I already figured it out. I meant where to tile the material for the particle. Found this in the particle editor. Thanks for your asset!
     

    Attached Files:

    • 322.JPG
      322.JPG
      File size:
      62.9 KB
      Views:
      297
    reuno likes this.
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @enyevg > Ooooh sorry you said materials. I read that too fast. So indeed, that's done via the texture sheet animation properties of the particle system. Technically you could also create a sprite renderer, then add an animator, etc, it would look the same, but would be way more costly. For that kind of stuff particle systems with texture sheet animation is the way to go.
     
    enyevg likes this.
  31. Marcsairu

    Marcsairu

    Joined:
    Feb 7, 2018
    Posts:
    9
    Hello reuno, how can I stop the player from respawning after death?
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Marcsairu > You can extend the LevelManager and implement your own rules. Simply overriding its KillPlayer method will let you redefine what happens when the character dies.
     
    Marcsairu likes this.
  33. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Hello,

    Is there a video Demo for the Pushable objects? It seems very straight forward, however my character goes through the object. Interestingly, when bring a prefab from the Demo's to troubleshoot, the character still goes through it. However the player is fine going up and down the moving platforms, and regular platforms. It moves and jumps fine as well.

    Is there something I'm Missing ?

    Thank you for the tool, extremely useful.
     

    Attached Files:

  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Aprn > I suppose there's something you're missing, but it's hard to tell just from that screenshot, I'd need detailed steps of what you're doing. You'll find examples of different pushables throughout the demo levels (RetroPush's got the most of them), and more info about the various push abilities in the documentation. My first guess would be that your character's layermasks are wrong, I'd recommend comparing them against the demo characters' ones, assuming the issue doesn't happen with them. If the problem persists, please use the support form and provide more info about your context and steps to reproduce your issue.
     
    TheAPGames likes this.
  35. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Thank you so much for you reply.

    As im learning the tool, i basically created a 3D object, added a 2D riggidbody, 2D box collider, a Pushable component and lastly set its layer to Pushable.

    In the grounded layer mask, it is set to Moving platforms, pushables and one way platform, which i think was the default.

    The Player/character is also set to Player layer. If that helps narrow it down.

    I have attached a clearer image for your reference.

    Thank you again for your time
     

    Attached Files:

    • 2.png
      2.png
      File size:
      47.9 KB
      Views:
      275
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Aprn > As I said, your issue likely lies in your characters layermask settings. It's unlikely to come from your pushable block, as you mention having the same issue with the demo blocks. So again, try comparing with the demo characters, you'll find your difference. And if the issue persists, please use the support form, thank you.
     
    TheAPGames likes this.
  37. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44

    You are absolutely right, I brought in a playable character from your demo and it stops when it hits the Pushable box. I compared the two, then i set my mask to pushable as well as platforms. Now it stops when it hits the box. Have to figure out how to push it now :D, Thank you so much Reuno
     
    reuno likes this.
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Aprn > Lucky guess then, glad I could help!
     
    TheAPGames likes this.
  39. Marcsairu

    Marcsairu

    Joined:
    Feb 7, 2018
    Posts:
    9
    Hello reuno, I created a new script but I can't call it on any of the corgi engine scripts. I am using GameObject.FindObjectOfType but the script doesn't show.
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  41. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Hello Reuno,

    I really enjoy the way the way that your Playable character behave when they change directions.

    • In terms of the 3D Corgi, it has a lovely smooth rotation toward the camera then faces the other direction? In what component is that controlled/edited? On your 2D playable characters, the same happens when they flip as well.
    • Second question is : I noticed in your latest New Corgi 3D, the main floor (Ground) that the player starts has a regular box collider but the platforms have a box Collider 2D. I'm very curious as to why that is even though you have mentioned the engine only works with 2D colliders?


    Thank you kindly for the replies.
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Aprn > 1. That's handled by the Character class, which lets you decide (from its inspector) whether you want your model to flip (on its x axis) when changing direction, or rotate. If you opt for a rotation, it lets you define the speed at which the rotation should happen. You could have it instant or fairly slow, as is the case on the NewCorgi3D prefab.
    2. Forgot to remove that collider, it came with the cube, will clean that :) The engine indeed works only with 2D colliders, all 3D colliders will be ignored (by the engine's classes, you could still have 3D things colliding on the side if you'd like).
     
    TheAPGames likes this.
  43. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Amazing....


    Thank you, i would need to buy you lifetime pass for beer for all the silly questions. Thanks again
     
    reuno likes this.
  44. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Hello, Could anyone please tell me what this error means and how to fix? Upon this error, the game stops working, and have to stop, then press play again. It happens when i go to check out the demo scenes, i think when i play with the MMfeedbacks mainly.

    Unable to load the icon: 'vcs_incoming'.
    Note that either full project path should be used (with extension) or just the icon name if the icon is located in the following location: 'Assets/Editor Default Resources/Icons/' (without extension, since png is assumed)
    UnityEditor.EditorGUIUtility:IconContent (string,string)
    MoreMountains.Feedbacks.MMFeedbacksEditor:OnInspectorGUI () (at Assets/CorgiEngine/ThirdParty/MoreMountains/MMFeedbacks/Editor/Core/MMFeedbacksEditor.cs:320)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)




    Thank you
     
  45. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    99
    Hello @reuno, I have two questions about Feedbacks usage.
    1. I have a particle effect bound to a custom weapon, I have a feedback triggered with Used event and I need this particle to repeat until the end on weapon's use - it works but i don't know how to stop the particle when the weapon stops working. I tried using the loop on the particle or using the repeat forever on the feedback but when the weapon stops the particle keeps going. I have read the feedback docs and it says that Particle Play can stop particles, but I can't figure how. Is there a fast way to do it with corgi or do I need to write some code?
    2. When the character flips, the weapon flips correctly (damage area etc...) but the particle bound to the feedback doesn't. Same question as above.
    Thank you :)
     
    Last edited: Aug 26, 2021
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Aprn > MMFeedbacks use default Unity icons to display their play direction in their inspector. Unity decided to remove these icons from some 2020/2021 releases, without mentioning it anywhere, and so you get this error when displaying such an inspector. It's been fixed in Feel already and the fix is coming to the next update of Corgi Engine.
    @luigi7 > Weapons let you hook feedbacks for most of their steps. Play it on use, and have a feedback stop it on WeaponStop
     
    TheAPGames and luigi7 like this.
  47. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    99


    Thank you for the fast reply, but still I can't understand how to do the "have a feedback stop" ... sorry if it's a stupid question, but it would be very helpful if you tell me where is that.
    Then, how about the flip problem?
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @luigi7 > Weapons have hooks for most of their states :

    upload_2021-8-26_9-22-32.png

    From there, you can have a feedback play on Stop that will stop your particle system, either via a ParticlesPlay feedback, or an events one. Or you can simply implement a class that will do that for you.

    As for the flip, that's a setting on your particle system, regular Unity. Note that I won't see your questions if you edit your message as I reply to it. Please use the support form if you have more, thanks.
     
    luigi7 likes this.
  49. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    99
    It was not what I asked, I know that screen but I could not figure how to set up a feedback to stop particles, so in the end I wrote my own class to do it but thank you for the support, helpful anyway.
    Sorry, bad time to edit, you replied while I was editing. Anyway for some weird reason the particle did not flip with the weapon... rebooted and now it's ok.
    Thank you :)
     
    reuno likes this.
  50. fbqt

    fbqt

    Joined:
    Aug 27, 2021
    Posts:
    7
    Hi,
    Corgi engine looks very nice, I´m thinking of getting it. I´m a complete beginner, artist not coder. Should/could I use it with visual scripting? And also, like you suggested, do you still recommend the 2019.4.x version?
    Many thanks
    /Fred