Search Unity

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v6.0 : game feel, Cinemachine, and more]

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

  1. Legionghost

    Legionghost

    Joined:
    Nov 30, 2018
    Posts:
    16
    Hi, this may be a silly question but I searched the docs but can't find a way to set up a fade in/out after dying (staying in the same scene), I added a MMfader on the 'fader' in the UI and tried using MMFadeOutEvent.Trigger(IntroFadeDuration); when the player dies, but I don't think I'm doing it right. I'm probably missing something obvious.
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @Legionghost > There should already be a properly setup fader in all scenes, and already an example of a fade in/out in the LevelManager for reference. Please use the support email if the problem persists, thanks!
     
    Legionghost likes this.
  3. polyconvex

    polyconvex

    Joined:
    Aug 17, 2018
    Posts:
    7
    Hello everybody! Does anyone have a quick explanation for why this continuous movement with one keypress works for jumping but not for horizontal movement in this example? You don't have to provide code if you don't want to, just some guidance THX much!

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using MoreMountains.Tools;
    5. using UnityEngine.Events;
    6.  
    7. namespace MoreMountains.CorgiEngine
    8.  
    9. {
    10.         public class CharacterConstantMovement : MonoBehaviour
    11.     {
    12.  
    13.         bool continuousMovement;
    14.  
    15.         // Start is called before the first frame update
    16.         void Start()
    17.         {
    18.        
    19.         }
    20.  
    21.         // Update is called once per frame
    22.         void Update()
    23.         {
    24.             if (Input.GetKey(KeyCode.Y))
    25.             {
    26.                 continuousMovement = true;
    27.             }
    28.  
    29.             if (continuousMovement)
    30.             {
    31.                 InputManager inputManagerUiCam = gameObject.GetComponentInParent<InputManager>(); // The component is on UiCam
    32.                 inputManagerUiCam.JumpButtonDown(); // This works and Player jumps constantly
    33.                 inputManagerUiCam.SetHorizontalMovement(1); // This does not work and Player does not move right
    34.  
    35.                 CharacterHorizontalMovement charMovement = GameObject.Find("PlayerChar").GetComponent<CharacterHorizontalMovement>();
    36.                 charMovement.SetHorizontalMove(1);  // This does not work either
    37.             }
    38.  
    39.         }
    40.     }
    41. }
    42.  
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @polyconvex > Without context it's hard to tell but I'm guessing you have another ability that is setting that movement to 0 at the same time, probably CharacterMovement getting zero input.
     
    polyconvex likes this.
  5. polyconvex

    polyconvex

    Joined:
    Aug 17, 2018
    Posts:
    7
    I'm using just the basic abilities that come with the corgi engine default Player. I tried this with the minimal and retroadventure demos too, no luck.

    But if
    Code (CSharp):
    1.  .SetHorizontalMovement(1);
    or
    Code (CSharp):
    1.  .SetHorizontalMove(1);
    is the right way to do this then I'll figure something else out! thank you!
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @polyconvex > That's what I meant, by default the basic character movement listens for input, so it's already setting horizontal move, and that's where your conflict lies. You'll want to make sure that method only gets called once per frame at a time, otherwise the last call wins.
     
    polyconvex likes this.
  7. polyconvex

    polyconvex

    Joined:
    Aug 17, 2018
    Posts:
    7
    Oh of course, sweet! That did the trick totally. Thank you so much!! :D:cool:
     
    reuno likes this.
  8. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    15
    Can I use Anima2D with Corgi Engine?

    (I know spine, 3d/mecanim and spritesheets will work, but what about Anima2D? Its bone animation unity addon that is officially supported by Unity and is completely free, hence why I want to use it in particular.)
     
  9. RisingHigh

    RisingHigh

    Joined:
    Apr 30, 2018
    Posts:
    3
    Hey,

    I'm looking at this awesome engine as a choice for a new project we're looking to build - Is there a showcase thread or page anywhere to see live examples or other people games to get a real life example of what's possible pretty much out the box?
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
  11. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    15
    Excellent, thank you!

    In that case I think it will, since the end-product of Anima2D bone-driven animations of a nested/segmented character are regular Unity animation/animator keyframes.

    I'm currently comparing and gathering info on all the tools out there to see which I should commit to such as Puppet2D, Spine, Anima2D and recently Unity's own new native 2D animation system which can be seen here:
    https://blogs.unity3d.com/2018/11/09/getting-started-with-unitys-2d-animation-package/

    I also learned today that Unity hired the talent behind Anima2D, then gave Anima2D away for free. However unlike what I first thought, Anima2D is *not* going to be the basis for Unity's native solution. The person developing Anima2D is still improving Anima2D, but its competing with Unity's own solution. Its interesting to see which one a developer should commit to in the future, since Anima2D being free means its only still supported for the sake of having a better 2D bone animation tool, but recieving no monetary compensation for its development. I'm a bit worried for its future and have a thought that perhaps Unity's new prototype native 2D animation suite would be a better option.
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @Reactorcore3 > As long as your animation system interfaces with Unity's animator, it'll work natively with the engine.
    As for the best tool to pick, I'm partial to Spine myself, it's a great tool, and the one I've seen used the most in the industry.
     
    Reactorcore3 likes this.
  13. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    When using COrgin enjin with unity 2018.3.6f1 i am receiving some errors after import. Should I upgrade to later version of unity?
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @karmik > "Some errors" is too vague to give you an answer.
    I'd suggest upgrading to the latest stable, and if the problem persists, please use the support email and give me some details.
     
  15. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    15
    Hmm, are weapon hand placements exclusive only to 3D characters?

    I went to look at the examples and saw that the 3D Hunt guy can aim the gun freely, rotating it and the hands would be placed where the Left/Right handles are placed. The Minimal character does the Rayman thing where his hands are floating freely without connection to the body, which also allows him to aim anywhere.

    Meanwhile the spine based characters, spacecorgi and others do not have an option to rotate and place hands/arms/gun in the direction of aiming.

    Is there a way to have 2D characters place their hands on weapon handles like the 3D character can?
     
    hamzamomin300 likes this.
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @Reactorcore3 > That's called IK, and for now Unity only provides a native solution for 3D characters, so that's why you get an example of that. I know Spine also does, I wouldn't know about other systems, but it's usually quite specific to each system, so it really depends on which one you pick, but yes, of course it's possible.
     
    Reactorcore3 likes this.
  17. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    15
    Ok, how would I go about setting hand IKs for a human 2D character?

    I'm wondering if theres some sort of reference of the IK control gameobject I could pass onto the corgi engine that it could make the hand placement happen... or is there some other way it would need to be done?

    If its more complicated to achieve and there is no good tutorial for it, I can go the Rayman route and mimic the Minimal character with floating hands and some hacks, but I wanted to first find out if there is a way to make it work with an Anima2D or Spine based character.
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @Reactorcore3 > As I said that really depends on what animation solution you decide to use, they all do that differently, you'd have to check their respective documentation.
    But basically the idea would be to create an equivalent of the WeaponIK class for your system. What this class does is attach the weapon's hands to Unity's animator. You'll want to do that but pass that same info (and potentially more) to your specific APIs.
     
    Reactorcore3 likes this.
  19. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    15
    A custom class... that means programming and fiddling with systems I'm not familiar with.

    Eh, nah. That sounds more complicated than what I'm comfortable with getting into. I just wanted to check if I could simply add some kind of special gameobject that the Corgi engine's uses as a reference to find the hands of a character and automatically place them onto the handles. Something easy.

    Hmm I think I need to take a step back and try to organize my character in a more simple way and perhaps mix in some playmaker FSMs to get the result I'm looking for. I think that would be more doable, since its more familiar to me.

    Thank you for the answers, I appreciate the assistance.
     
  20. statrick

    statrick

    Joined:
    Oct 12, 2013
    Posts:
    4
    Hello, I'm wondering if there is an easy way to Trigger an animation (not death animation) when you use the Switch character script? I see that their is a built in way to trigger a particle effect. I'm wondering what parameter the engine uses to trigger that effect. Could this be use to trigger an animation as well?
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @statrick > There is no animation bound to switch character for now. I could add that to the todo list for sure. In the meantime the best way would be to extend the class and have it trigger an animation in the exact same way other abilities do it.
     
    DrSizzle, Quinn221 and statrick like this.
  22. Mcg

    Mcg

    Joined:
    Mar 28, 2012
    Posts:
    111
    hi, @reuno is it possible to get wall clinging to work automatically when the player is in the air and colliding with a wall rather than additionally needed player input to stick it against the wall? :)
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @Mcg > Sure, simply extending that class to change how it handles input will do the trick. The last update (and tutorial) includes an example of just that.
     
  24. Mcg

    Mcg

    Joined:
    Mar 28, 2012
    Posts:
    111
    Thanks, I've had a try but I found a bug perhaps? if you put two walls together (that are close but with enough space to jump and hit the opposite wall) and jump to the other side the IsCollidingLeft or IsCollidingRight bools depending which side the collision is not detected even next to the wall I imagine the repositioning from the raycast hit slightly puts it out of reach of the ray but I'm not quite sure, so this was making it difficult to make wall cling automatically when you jump or wall jump to it so I wrote a new wall cling ability that was pretty much the same but used a longer horizontal raycast but now makes kinda a mess having to deal with states in other abilities like horizontal movement interfering :eek:
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @Mcg > If you think you've found a bug I'll be happy to take a look, please send me steps to reproduce on the support email, thanks.
     
  26. hassonhamo3

    hassonhamo3

    Joined:
    May 25, 2018
    Posts:
    37
    hi thanks for your great asset , I have a problem with player rotation , when it spawns it doesn't face right or left but backward or forward I tried to rotate it and apply that to the prefab , but when it spawns the rotation resets to "0" I assume there's something wrong with the model ?
    Capture_2019_03_26_21_03_28_879.png
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @hassonhamo3 > Please use the support email for support, and explain a bit the situation, I can't guess what's wrong without details. My guess is you didn't nest the model properly as recommended in the documentation, but it's hard to tell from just that screenshot. Maybe have a look at the documentation and examples of 3D characters included in the asset, and if that doesn't solve it drop me a line, I'll be happy to help.
     
  28. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,009
    Hi,

    I'm working with Corgi for a retro inspired platformer and I've come across a couple of issues I can't seem to solve.

    1. I can't find an option to turn off air control when jumping. I don't want to be able to change direction of the jump in mid air.
    2. No matter what I do I can't jump from moving platforms. I've tried many different layers but my character just moves up a pixel and I can still walk off the platform.
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @derkoi > Please use the support email for support questions, thanks!
    1. There isn't one, but I can add it to the todo list if you want.
    2. I have to admit I'm not aware of any issue with the moving platforms. Please send me more details on how to reproduce your problem. In what demo scene, where exactly can I reproduce this? What version of the asset? What version of Unity, etc.
     
  30. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    18
    Hello i'm actually in test of all the corgi's features and it seams you don't have external trigger script to activate mobile platform at runtime (like an elevator with manual trigger). I made this kind of script for another 2D kit to do that, but before i start coding.. is it something in your todo list ?
    I already have all my sprites for my player and it's a metal slug kind ( half up separate from half down character sprite to walk AND aim + shoot or to do melee attack). The space corgi spritesheet seams to be the model i need to use, but actually the animation can only show "shoot animation" or "walk animation" : is there a way to separate the walking and shooting animation ? like using 2 layers in the animation animator, so i can have walk animation at the same time i aim and shoot. If possible i prefer don't use sprite rotation. Thanks by advance.
    btw, the asset contains lot of useful things good job :)
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @krisss666 > You can absolutely trigger moving platforms externally, there are even examples of that (key and chest demo for example, IIRC). What's preventing you to do so?
    As for animation, it's just a regular Unity question, there's nothing in the engine preventing you to do things differently. All the engine does is send and update animation parameters. How you decide to setup your characters is entirely free and up to you.
     
  32. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    18
    thanks, i'll check the chest for the trigger
    About the animations of shooting + walking at the same time, i don't think i can just add a layer and put the shoot animation without modifing your script ?! So i just ask some hints to do that, unless someone already make it
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @krisss666 > It'd depend on what exactly you're after, but there's a lot you can do with the animator parameters that are already being sent. With aiming direction for example you could already do what I think you're after just in the animator, without the need for extra code. But sure, if it's not enough you can always extend the script to add your specific behaviours, that's what the engine's been built for.
     
  34. Legionghost

    Legionghost

    Joined:
    Nov 30, 2018
    Posts:
    16
    Hi, I'm trying to setup a weapon that fires 3 shots, one on top of each other.
    So in the ProjectileWeapon component I have it set to ProjectilesPerShot = 3 and a Y Spread = 1 but this isn't working, it's creating 3 PlayerParticleExplosions when it hits the walls so it looks like it's spawning 3, but, is there a setting I am missing?
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @Legionghost > You can look at the RetroCopter's weapon for reference on that. If the issue persists, please use the support email and provide more details, thanks.
     
    Legionghost likes this.
  36. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,009
    Hi, thanks for the reply. I think adding the option for air control would be good in the future.

    The moving platform issue was my fault. I editing the controls so I could use Rewired but then realised that Rewired has it's own integration so used that and it works properly now though.

    Something else I'm puzzled about though, is that I want my player to explode into a particle system when touched by an enemy, I have the particle system working fine but no matter what settings I change my player still drops off screen instead of disappearing instantly.
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @derkoi > You can look at the RetroCopter setup for an example of exploding into particles on death.
     
    derkoi likes this.
  38. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    18
    Thanks for earlier hint, the animator can fulfill my need for the split animation. I just add some code to flip the child object which contain the upper body when core body flip.
    I try your weapon demo and we can bind weapon to mouse or analogic controller. Nowaday player want to select their device, so is there a simple method to manage both controller for the same weapon?
    - duplicate weapon for each device (controller / mouse) and use a script to switch seams to be a pain
    - change the weapon dropdown option by script to select mouse or controller before use it
    - there is another solution ?
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @krisss666 > No need to duplicate anything, simply change that via script :)
    I mean technically duplicating would also work but that'll make maintenance complicated.
     
  40. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,009
    Hi, I took a look at that scene but aside from the Health script, which is the same settings I'm using for my character, I don't see anything else that instantly destroys the player.
     
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @derkoi > On the Health script you can decide what happens to your character on death. Please use the support email if you can't solve this by comparing with the example.
     
    DrSizzle likes this.
  42. Legionghost

    Legionghost

    Joined:
    Nov 30, 2018
    Posts:
    16
    Took me a bit to figure it out, it's in the Animator, remove your death sprite animation and just add a Sprite Renderer.Enabled property and set it to disabled.
     
    derkoi and reuno like this.
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    That, combined with DestroyOnDeath settings, DeathEffect, DelayBeforeDestruction, and other death related settings. But you'll indeed need a proper death animation (simply hiding your sprite will work of course).
     
  44. RGroff

    RGroff

    Joined:
    Feb 6, 2019
    Posts:
    3
    Has anyone had difficulty locating the 'GoToLevelEntryPoint' script? I/search can't locate it. Has it been removed, or am I looking/searching in the wrong area?
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @RGroff > No, it's still here. What version of the engine are you running?
     
  46. RGroff

    RGroff

    Joined:
    Feb 6, 2019
    Posts:
    3
    ....embarassingly, a much older version than the current one. Thank you for the response!
     
    reuno likes this.
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @RGroff > Let me know if the problem persists after updating, I'll be happy to help.
     
  48. Shekkles

    Shekkles

    Joined:
    Mar 16, 2014
    Posts:
    3
    Hey @reuno is it a feature down the line to add 4 player coop? Possibly with classes.
     
  49. Kelgand

    Kelgand

    Joined:
    Feb 3, 2018
    Posts:
    10
    This is already possible, the engine supports multiplayer and adding classes (which I take to mean characters that look different and/or have different abilities) is something you would implement. The Corgi Engine is a wonderfully made base engine, it is up to you to style it in the way you want your game to look (but that is really easy [comparatively to doing it from scratch] to do with how well the engine was made). That includes the design of your characters and the abilities your characters have.
     
    Pacaworks and reuno like this.
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,079
    @Shekkles > @Kelgand pretty much said it all (thanks!). There's already support for local multiplayer. From there, implementing your own specific rules should be pretty easy. I don't plan on adding anything as specific as "coop multiplayer with classes", that's both too vague and too specific :) If you have more specific questions drop me a line I'll be happy to help.