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] 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. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    17
    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?
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
     
  3. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    17
    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.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
  5. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    17
    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.
     
  6. 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?
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
  8. Mcg

    Mcg

    Joined:
    Mar 28, 2012
    Posts:
    112
    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? :)
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
     
  10. Mcg

    Mcg

    Joined:
    Mar 28, 2012
    Posts:
    112
    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:
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
     
  12. hassonhamo3

    hassonhamo3

    Joined:
    May 25, 2018
    Posts:
    38
    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
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
     
  14. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    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.
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
     
  16. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    21
    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 :)
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
     
  18. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    21
    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
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
     
  20. 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?
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
  22. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    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.
     
  23. reuno

    reuno

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

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    21
    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 ?
     
  25. reuno

    reuno

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

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    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.
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
  28. 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.
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    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).
     
  30. 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?
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @RGroff > No, it's still here. What version of the engine are you running?
     
  32. 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.
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @RGroff > Let me know if the problem persists after updating, I'll be happy to help.
     
  34. 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.
     
  35. 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.
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @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.
     
  37. hassonhamo3

    hassonhamo3

    Joined:
    May 25, 2018
    Posts:
    38
    hey ! how to use Ik ? I have punch animation and I want to use it while running or idle ..etc so i only want the hands to be effected by the animation not the whole body
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @hassonhamo3 > What you describe is (likely) not IK, but rather layered animation. IK is a different thing (hands that remain on a gun while aiming for example). This is just regular Unity though, nothing to do with the engine. I'm sure Unity has some documentation on that : https://docs.unity3d.com/Manual/AnimationLayers.html (just the first result in google, there are definitely more resources out there).
     
    hassonhamo3 likes this.
  39. hassonhamo3

    hassonhamo3

    Joined:
    May 25, 2018
    Posts:
    38
    @reuno wow thank you so much for the quick reply and the great information :D
     
    reuno likes this.
  40. Shekkles

    Shekkles

    Joined:
    Mar 16, 2014
    Posts:
    3
    Apologies I was very unclear. I forgot the word "online". The local co-op is fantastic but I was wondering if online multiplayer is in the mix for a future feature?
     
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Shekkles > No, online coop (or online anything) isn't planned, as really the online implementation really depends on your game's rules, there's no silver bullet, so it'd be impossible to provide a generic solution that would accomodate for all the possible game styles you can create with the engine. And providing just one example would be of little value unless you just so happen to work on that exact same game.
     
  42. DrSizzle

    DrSizzle

    Joined:
    Feb 16, 2018
    Posts:
    2
    Is it possible or can it be added?
    When damage is taken by player or enemy we can control the direction they get thrown or pushed? If I hit an enemy with an uppercut I’d like to be able to have then hit into the air. Or like turtles in mario they can be pushed when jumped on? Or if meleed from behind to fall forward. Also, various death animations for both player and enemies?

    Anyone have some answers?

    Thanks
     
  43. Legionghost

    Legionghost

    Joined:
    Nov 30, 2018
    Posts:
    16
    For weapons I see you have many types we can work off of but no beam weapons, is that something on your todo list?
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @DrSizzle > All that is possible. You can define force applied per weapon, that's knockback force, as explained in the documentation. As for various death animations, that's something you typically handle in your animator, just have some random parameter in there you can act upon.
    @Legionghost > It's on the todo list, although it's really just visuals at this point, so it's quite low as it's already doable.
     
    DrSizzle likes this.
  45. Robutmike

    Robutmike

    Joined:
    Nov 25, 2013
    Posts:
    4
    Hi @reuno love your asset! I am going to update the Dash ability to be able to dash upward and diagonally as well. Before I start trying to delve into that, would you mind to give me a little direction on how you would go about doing that? I don't expect you to do the work, just want some pointers on how you might set it up so that I could potentially save myself a little headache.

    Thanks!

    EDIT: Got it working already. Created a new character ability based on the Dash ability and removed the portion in the first ProcessAbility() section that sets vertical force to 0, then I just slapped the vertical input into a new _computedDashForceVertical and multiplied that by dash force. Then finally setVerticalForce to that computed value.

    Very readable, very well commented. Thank you.
     
    Last edited: Apr 10, 2019
  46. tallesmaziero

    tallesmaziero

    Joined:
    Feb 3, 2018
    Posts:
    19
    I'm using the 2018.3.12fl version of unity and corgi engine 5.4. I created a platform using rule tile and then create a character with auto build. Now i can't jump with this character or walk into a 45º slope. What am i doing wrong?
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Robutmike > You were too fast! Coincidentally I've added that feature to the next update a few weeks ago.
    @tallesmaziero > Nothing, slopes over 45° are considered as walls.
     
  48. Tycellent

    Tycellent

    Joined:
    Nov 7, 2014
    Posts:
    27
    I'm thinking of getting the corgi engine but does the corgi engine have some sort of implementation that handles the sprite's animation from "sliding" as they move?
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Tycellent > I'm not sure what you're referring to? What exactly is a sliding sprite animation? Do you mean like pixel perfect camera? If yes, that's native in Unity now (and there are examples of pixel perfect scenes in the engine).
     
  50. Tycellent

    Tycellent

    Joined:
    Nov 7, 2014
    Posts:
    27
    oo thanks for the fast reply! Sorry about not being clear. Yeah so with my sprite animations at the moment it seems like i need to match the stride of the sprites with the movement so it doesn't look like they're "sliding". So during 1 step of the sprite they may move an amount of space that's too big and it makes them look like they're sliding instead of moving 1 step at a time. Hopefully that clarifies things but i can send a gif if need be.