Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v6.6 : ability split, recoil, hitscan...]

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

  1. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    157
    Is possible to integrate Corgi with the New Input System?
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @wagenheimer > Yes, it's possible. Right now the recommended way is to extend the InputManager to do so.
     
  3. C4RL4

    C4RL4

    Joined:
    May 19, 2020
    Posts:
    3
    Heyy, I need a lil help, sorry if this was answered before, but I read the documentation and searched the forum and couldn't find anything
    So I tried creating a new AI Action DamageDash by just taking the AI Action Jump and replacing all 'jumps' with 'damagedashs' as well as the 'JumpStart()' with 'InitiateDash()'. The game runs now but the character doesn't dash and I get the error 'NullReferenceException: Object reference not set to an instance of an object'
    I'm sure I'm doing something obvious wrong but I'm very new to coding and still quite bad, so I'd appreciate a little help~

    Also btw the engine is incredible and even for a beginner like me really intuitive to use :)
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @C4RL4 > The first thing you'll want to do is identify what that error is referring to. There's probably a line in the console stack it's pointing to. Look at that. Then look at that line, and identify what is null. Then figure out why it's null (it's likely a variable you never initialized, or you're trying to grab a component that isn't there maybe. And move on from there :)
     
  5. C4RL4

    C4RL4

    Joined:
    May 19, 2020
    Posts:
    3
    thx for the fast reply first of all :]
    so the error lists all of these* but I'm honestly not sure what to do with that.. the only thing I can think of is that maybe because it's a derived class of the normal dash and all the functions are in there, it has problems accessing them?

    *
    MoreMountains.CorgiEngine.CharacterDash.ComputeDashDirection () (at Assets/CorgiEngine/Common/Scripts/Agents/CharacterAbilities/CharacterDash.cs:165)
    MoreMountains.CorgiEngine.CharacterDash.InitiateDash () (at Assets/CorgiEngine/Common/Scripts/Agents/CharacterAbilities/CharacterDash.cs:151)
    MoreMountains.CorgiEngine.CharacterDamageDash.InitiateDash () (at Assets/CorgiEngine/Common/Scripts/Agents/CharacterAbilities/CharacterDamageDash.cs:31)
    MoreMountains.CorgiEngine.AIActionDamageDash.DamageDash () (at Assets/CorgiEngine/Common/Scripts/Agents/AI/Advanced/AIActionDamageDash.cs:44)
    MoreMountains.CorgiEngine.AIActionDamageDash.PerformAction () (at Assets/CorgiEngine/Common/Scripts/Agents/AI/Advanced/AIActionDamageDash.cs:34)
    MoreMountains.Tools.AIState.PerformActions () (at Assets/CorgiEngine/ThirdParty/MoreMountains/MMTools/Tools/AI/AIState.cs:92)
    MoreMountains.Tools.AIBrain.Update () (at Assets/CorgiEngine/ThirdParty/MoreMountains/MMTools/Tools/AI/AIBrain.cs:71)
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @C4RL4 > My guess would be that you didn't initialize your dash component.
    As I said, you should try to identify what variable is null in your code, and figure out why. I don't think the issue is on the engine's side here, it's likely on yours.
     
  7. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    124
    Check the character jump script and compare it to the advanced AI example - that will give you a better understanding of how the AI accesses and executes the ability.

    Review the character dash and/or damage dash scripts as well and see how the dash is executed.

    Don't forget the API Document - it shows you how the code is structured and is easier to search/navigate than the Unity UI or script editor (imho).
     
  8. Cunny-Lang

    Cunny-Lang

    Joined:
    Jul 30, 2019
    Posts:
    15
    Hi!
    Can I make a very small delay after pushing a jump button (like 0.1s) and how? It's for animation at first, because now it's like jump animation starts with 2nd frame somehow. I can see it, cuz my character sets crouch for a few secs (.anim) but in game after pressing jump he skips crouching and jumping already "stretch"
     
  9. Cunny-Lang

    Cunny-Lang

    Joined:
    Jul 30, 2019
    Posts:
    15
    And anyway about animation, but not about very small delay after pressing jump button. Like "Jump knight" vut not so much)
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @Cunny-Lang > >that's not something that's built-in (the engine encourages tight gameplay, delay before jumps are not something I'd recommend in most situtations), but you can easily implement that by extending the CharacterJump ability.
     
  11. Grafos

    Grafos

    Joined:
    Aug 30, 2011
    Posts:
    222
    Pre-jump/Post-jump animation support. I've requested this too in the past. I think it's very useful for enemy characters, which is my use case. Also useful for certain platform games that could be a perfect fit for Corgi, such as Another World/Flashback.
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @Grafos > I haven't forgotten about that, and it's coming :)
     
    javi_unity402 and Grafos like this.
  13. pandemik

    pandemik

    Joined:
    Mar 23, 2017
    Posts:
    9
    hello @reuno Ive been having trouble getting my lives to work or show on mobile devices yet its working perfectly in the editor, is there something that im missing?
     
    Last edited: May 25, 2020
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @pandemik > I suppose that depends on why it's not showing. Could be that your UI doesn't resize properly, or it's a z position issue, or something else.
     
  15. pandemik

    pandemik

    Joined:
    Mar 23, 2017
    Posts:
    9
    @reuno I thought that was the issue but i have unlimited lives and the gameover screen never initiates, its definitely something that i'm doing since it works correctly on a untouched build. Could it have something to do with me implementing a healthbar on the Retro Adventure demo?
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @pandemik > Hard to say for sure, but this looks completely unrelated to me.
    I'd suggest using debug tools to see on your build what the issue could be.
     
  17. unity_YoaP2NCvxCuybA

    unity_YoaP2NCvxCuybA

    Joined:
    Mar 16, 2019
    Posts:
    1
    reuno likes this.
  18. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    88
    Dear reuno, When I have the CharacterGravity component enabled, parenting the character to a rigidbody while keeping it's original position/rotation/scale does not work correctly. I'm using the
    public void SetParent(Transform parent, bool worldPositionStays);
    method with true as boolean. What happens is when the character touches the rigidbody while it is turned upside down and laying dormant, the character will be parented to that rigidbody and also be turned upside down and placed below the rigidbody as if the character stands with inverted gravity based on the rotation of the rigidbody. Aside from this, the character is also applying a force to the rigidbody even though Physics 2D Interation is turned off on the corgi controller. For now I made a quick hack that has the CharacterGravity component turned off all the time and when you jump off the rigidbody, it will be turned on for one frame so the global downwards gravity takes over again and the character falls correctly. That works allright for now however I would like it that the character does not influence the rigidbody when standing on it.
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @Cambesa > If you want to parent the character to something else, I'd suggest disabling its controller and all its parts entirely, it's not supposed to be controlled like that.
     
  20. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    88
    In our game, the character should be able to walk on top of the rigidbody so I can not disable the character components. I'm basically trying to make a moving platform that uses physics instead of paths. Using v6.2.1 btw. It's the core mechanic in the game, moving the rigidbody with one character and standing on it with another so I really hope it's possible.
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @Cambesa > You'll have to implement that feature then, that's not something that is built in.
    The engine is not physics based, that's its main feature, and what you describe would typically be a physics interaction.
    I can add that to the todo list if you'd like though.
     
    Cambesa likes this.
  22. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    88
    I'll see if i can extend/override the gravity class then so it ignores certain behaviour when the character is parented to another object. The biggest problem I don't know how to fix yet is how to make the character not influence the rigidbody when standing on it even though physics interaction is turned off. If you could point me in a direction that would really help. If more people request that kind of moving platform behaviour then it's good to add it to the to do list but you probably have enough to do already
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @Cambesa > I'd recommend asking on the MM Discord, I know some people there (at least one) has done so in the past, maybe you could get help there. As for the rigidbody, I'm not sure what your issue may be, the character doesn't apply force to rigidbodies unless you specify that it should. Looks more like a physics issue than an engine one. If you can provide exact repro steps via the support form I can have a look.
     
  24. piccolodmq

    piccolodmq

    Joined:
    Jan 7, 2020
    Posts:
    32
    reuno likes this.
  25. pandemik

    pandemik

    Joined:
    Mar 23, 2017
    Posts:
    9
    thank you, will do!
     
    reuno likes this.
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @Cambesa > I was gonna add a new item to the todo list with your request, but it turns out it fits within a more generic request for "universal" moving platforms, which has been heavily requested. I'd say there's a chance it'll be in the next update. Drop me an email if you want to test it before it gets released.
     
    Cambesa and Boom_Shaka like this.
  27. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    67
    Hello, I don't know if my question suits here o should be placed with the form but:
    in my scene in cant unpause pressing esc again, it pauses but then escape will not do the unpause.
    The examples included work fine, so it's about my scene: your code is complex and I can't see what I am missing, maybe is it something triggered form the UI?
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    That's handled by the input manager, and the CharacterPause ability, as explained in the documentation.
    These are the only two things you'd need for this to work.
    If that doesn't solve it, don't hesitate to send me more info about your scene via the support form :)
     
    luigi7 likes this.
  29. piccolodmq

    piccolodmq

    Joined:
    Jan 7, 2020
    Posts:
    32
    Is there anything we could see the upcoming possible features on 6.5 :)?
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    javi_unity402 likes this.
  31. GoranRiddle

    GoranRiddle

    Joined:
    Dec 10, 2015
    Posts:
    2
    Hi. I bought the asset on april 22 but somehow it is still downloading the 5.4 version, as said in the readme. I noticed because I was looking for the CharacterAutoMovement component but it is not included in my downloaded version.

    I am using Unity 2018.4.22.
     
  32. Grafos

    Grafos

    Joined:
    Aug 30, 2011
    Posts:
    222
    The latest version requires Unity 2019.3.3f1 or higher
     
    reuno likes this.
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @GoranRiddle > The asset store just displays the latest version and changelog of any asset, not necessarily the one you'll get.
    As for the documentation, there is no dedicated one for older versions, but the one online still applies, aside from the new features introduced more recently of course.
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @GoranRiddle > These are very unlikely errors (especially because that Unity version change won't get you a different engine version). I can't think of anything that could cause this.
    Please use the support form and provide detailed steps of what you did to update, what version you were on, the steps you took, what version you're on now. Maybe with a bit more context I'll be able to help.
     
  36. Cunny-Lang

    Cunny-Lang

    Joined:
    Jul 30, 2019
    Posts:
    15
    Btw it's still v6.3 at the headline)
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    Cunny-Lang likes this.
  38. _Exerion

    _Exerion

    Joined:
    Dec 3, 2014
    Posts:
    8
    Hello @reuno

    There is a bug in the
    CharacterWallClinging
    ability. The
    RaycastVerticalOffset
    parameter is used only in one place:
    TestForWall()
    and only when facing right.

    It should be used in 4 places instead:
    TestForWall()
    when facing both left and right
    ExitWallClinging()
    when facing both left and right
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @_Exerion > If you think you've found a bug, please use the support form to report it, and provide repro steps to your issue, as well as context info (Unity version, engine version, etc). Thanks!
     
  40. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    Hi guys, I am familiarizing with Corgin Engine since a couple of weeks, trying to experiment a bit before starting a small project.
    I have three issues what I am struggling with at the moment, and I was wondering if you could help.

    1) The first one is about how to properly set a landing animation for a jump. I have the jump split into 3 separate animations (jumping, "in the air"-loop and landing). I did setup an animator looking at the tutorials and at the Rectangle animator, but somehow I have a problem with the landing. I see that the HitTheGround boolean is set to true, but it stays so only one frame, and the moment it resets, the Idle animation kicks in, therefore skipping completely the landing animation. (i see that the animators enters for a microsecond the JumpEnd state, but then i goes back to Idle).
    This is my animator, and I am not sure where else i could intervene so to prevent this.

    Screenshot_314.png

    2) The second problem I face is about shooting. My character has no real weapon, but has a shooting animation that spawns a projectile. I did treat it as a weapon, creating an invisible weapon with bullets and all, that causes the character animator to switch to the RangedAttack state.
    The problem is, if the player shoots during the second frame of the animation (it charges up its hands nad shoots), so the bullets shouldn't start right away at click, but wait for 1 frame. I added a 0.1 (then 0.2 seconds) delay to experiment a bit with it. The problem is that with delay, i need to hold the trigger clicked, if i click multiple times, it interrupts the previous action, i see that the first frame of the shooting is played, but it stops there and no projectile is spawned.
    Is there a way to solve this that you might think of?

    3) The third and last, i am not fully sure but it might actually be a bug. It happened to me a few time (in the editor) what while testing my workbench level, the player character dissolved and was respawned at level start as if it had died. I am quite sure it was in full health though. Is it any known bug or might it be caused by something i did set wrong (maybe level bounds or similar?) it's not a very common occurrence, but let's say i had it in 1 every 15-20 runs at least.

    Sorry for the wall of text, and thanks in advance for your time. Corgi's a pretty cool tool, i hope i can get along with it soon!

    Cheers,
    H
     
    Last edited: Jun 2, 2020
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @drHogan > Please use the support form for questions like these, thanks.
    1. As explained in the documentation, using a "any state" pattern is probably not the easiest way to set things up, especially if you're not too comfortable with Unity's animator. Instead, look for more traditional patterns. The RetroCorgi's one is more suited for what you're after. In any case, the reason why your animation doesn't play is probably because it's being interrupted by another one.
    2. Same thing, you probably have an animation interrupting your shoot animation. Not sure I understood the issue correctly though. If it persists, please send exact (written) repro steps from any demo via the support form.
    3. Never seen that before, and it's never been reported either. Again, I'd need exact repro steps to be able to understand what's happening. Edit : maybe your level bounds are wrongly setup indeed. Can't think of anything else that could cause this.
     
    Last edited: Jun 2, 2020
  42. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    124
    It sounds like your animator is working correctly.

    Think about the mechanics of a jump and how you are identifying/defining where your character is in the jump cycle. IE: "HitTheGround" means, by definition, that your character is no longer "jumping"....it's grounded. Therefore, it may not be the parameter to use during a jump cycle.

    Take a look at the parameters again and don't forget that you can use several parameters at once to get your animation exactly right.
     
    reuno likes this.
  43. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    Hi, I agree, and I know it's about a single frame hit as i said. Given that i am trying to learn along the guidelines of Corgi, i'd need to find anyway a way to control that animation. Given that landing animation is a quite common animation to give weight to sprites, i was asking if there's a proper way to handle it in the corgi way!

    The animation of Landing, needs to kick in exactly when the jump ends, and that would be perfectly correct for me. I just need to find a way to prevent the idle base state to kick in and interrupt my landing basically.
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @drHogan > There's not really a "corgi way" when it comes to animation, as the engine doesn't do animation, Unity does. What you'll want is to make sure your transition doesn't get interrupted, that's what's happening right now. Preventing that will fix your problem :) The NewCorgi3D demo character has one already setup if you need inspiration.
     
  45. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    Well yes, when I say the "corgi way" i mean using the way Corgi has this set of animator parameters and inner changes of states. Let's say that I would love to push corgi as far as it can get before i need to modify the code! Will check the NewCorgi3D demo one then, thanks for the tip!

    May ask you @reuno if the second problem I did ask information about is something you have tips about as well? (the shooting with delay)
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @drHogan > There's no need to modify the code to solve your issues, it's purely on the animator side :)
    As for your second question, as I said, either it's also an animator issue, or I didn't get the problem. Please provide more info via the support form, as well as repro steps, and I'll be happy to have a look.
     
  47. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    thanks Reuno, I will upload the test project with the steps tomorrow morning and send you the link via support form!
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @drHogan > No need to upload anything, simple repro steps from a fresh install, in any of the demos will do just fine, thanks!
     
  49. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    I think it's probably easier to show it on my project though as it's related to this shooting setup that I couldn't find in the demos
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,840
    @drHogan > It'd be much easier if you could just provide repro steps from a fresh install, thank you.
    That helps pinpoint the problem. You'll find plenty of projectile weapons throughout the demos, and you can add delay to any of them. You'll also be able to define interruption rules on all of them, so that shouldn't be a problem :)
     
unityunity