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. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    As I'm not a coder, is there an easy way to make the player's character run at all times (forced run) and change direction when it hits a wall (or certain layer)?
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @HeathC > I don't know of a way that wouldn't involve coding it for now, no.
    It'd come down to building an ability that commands the CharacterRun ability, and changes CharacterHorizontalMovement's direction based on wall collisions. All the bricks are there and that's quite easy to implement, but indeed requires coding, as most new features do :)
     
    HeathC likes this.
  3. Svonsil

    Svonsil

    Joined:
    Jun 24, 2018
    Posts:
    13
    Hello! How can I make ai character to play an animation while colliding with object and how can i make it to run away from this object when he see it.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @Ferege > Both of these things can be easily done using raycasts. You'll find plenty of examples of that throughout the engine.
     
  5. Svonsil

    Svonsil

    Joined:
    Jun 24, 2018
    Posts:
    13
    HI! I DON'T UNDERSTAND HOW CAN I MAKE MY CHARACTER TO PLAY ANIMATION WHEN HE USES WEAPON I READ DOCUMENTATION BUT IT DOESN'T WORK. HELP ME PLEASE (SORRY FOR CAPS LOCK MY PC IS LAGGING)
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @Ferege > "It doesn't work" (or its caps lock equivalent) is not enough to help, you'll have to provide a bit more info. I'd suggest reading the documentation again, as it really covers everything there is to know about that, watching the video tutorial, and looking at the many examples included in the engine. Maybe look at some entry level Unity animation documentation as well, as really there isn't much specific to the engine when it comes to that. And if the problem persists, please use the support form and provide more info, thanks.
     
  7. theindielawyer

    theindielawyer

    Joined:
    Mar 25, 2016
    Posts:
    21
    Hey all! I'm trying to set up a system where the projectile of my weapons inherit their damage variables from the corgi weapon itself (which can differ depending on an enemies "level"). So far I'm thinking the best way to do this is for the projectile to inherit from the weapon in question as a parent. Just wondering if anyone has tried something similar? Can anyone think of a sensible way to instantiate the pool of a weapon as its child?
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
  9. theindielawyer

    theindielawyer

    Joined:
    Mar 25, 2016
    Posts:
    21
    reuno likes this.
  10. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Hi can you please provide a short example on how to extend CharacterHorizontalMovement for auto run? Thank you.
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @gamezuv > That's planned, it's on the todo list. I'll add your vote to it.
     
  12. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Cool. I am starting my endless run project next month. Do you have a rough time frame in mind? If its going to be more than a month can you guide me where to start? I would just need 1 example of how to change the movement input . I can pick it up from there. Ty
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @gamezuv > This feature is still relatively low on the todo list, I can't give an ETA for it.
    But it's quite easy to do, it comes down to extending CharacterHorizontalMovement, and overriding the HandleInput method so that it doesn't look for actual input but you pass it whatever value you prefer.
     
  14. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Aah. Okz. Its easy for you to do :p...I am an artist but will take a shot at it today. Will have to google on how to extend scripts I guess...Thank you.
     
  15. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Done! I added autoMovePlayer on my character and removed CharacterHorizontalMovement. Working but just to confirm...Did I do it right?

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using MoreMountains.Tools;
    5.  
    6.  
    7.    
    8. namespace MoreMountains.CorgiEngine
    9. {  
    10.    
    11.  
    12.    
    13.     public class autoMovePlayer : CharacterHorizontalMovement
    14.     {
    15.    
    16.         public float myInputH;
    17.    
    18.        
    19.         protected  override void HandleInput()
    20.         {
    21.            
    22.             _horizontalMovement = myInputH;
    23.        
    24.         }
    25.        
    26.        
    27.        
    28.        
    29.     }
    30. }
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @gamezuv > If it works you did it right :)
    And yeah that's exactly how it's done, good job!
     
  17. KriYorDev

    KriYorDev

    Joined:
    Oct 3, 2017
    Posts:
    32
    Hello all,

    I am in need of some assistance but will try to be short. I am making a boss battle and started from the already existing RabbitBoss. The AI functions themselves work, but I wanted to be able to activate certain animations on my boss via a trigger collider. So, for example, you pass through the collider and some specific animation clip from the Animator attached on the boss is played.

    So, far I couldn't find the right way to do it. I did manage to fire a script that would Play a clip with a string, but the result was very buggy. For example, if activated, the animation played, but then my boss doesn't go into Idle mode and became blocked from playing any more animations. Or the Idle animation interrupts the first one, thus just having a stutter. I want it to always return into Idle. Even, if interrupted by another trigger, playing a different animation, it should still finish with the Boss in Idle animation, but after the currently triggered animation has finished.

    I tried using the MM Trigger and Collider script too, but it never works for me no matter if I just want to activate a GameObject. Another way too look at is, the weapons the Rabbit Boss has. They activate animations when shooting for example, but on the weapon itself. Maybe a solution could be to somehow make the weapon firing to activate an animation clip from the Model of the RabbitBoss. In my case, my boss has a weapon, but it's not visible, so I don't need animations on it.

    Any suggestion would be welcome. Maybe I am approaching this in a very wrong way. It's the first time I am trying a dynamic boss battle.
     
  18. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    @gamezuv just leveled up in c# !
     
    Boom_Shaka and reuno like this.
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @kriyordev > You probably need to change your animator's setup then. Parts like "Or the Idle animation interrupts the first one" are a big clue that your animator setup is likely the problem here. I'd suggest making sure no animation can interrupt your desired animation. This can be done like in any Unity project (nothing specific here) by tweaking transitions and conditions.
     
  20. KriYorDev

    KriYorDev

    Joined:
    Oct 3, 2017
    Posts:
    32
    I used one that already works quite well when I use it the normal way within a Character or AI. For some reason I can’t find a way to externally trigger a specific animation on another game object via a trigger collider.

    I will go back to Animator again though. Maybe something really is wrong with how I state the conditions.
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @KriYorDev > It'd probably be something like collider.GetComponent<Animator>().SetBool("yourBool", true), for example.
     
  22. TheAngryTophat

    TheAngryTophat

    Joined:
    Apr 13, 2018
    Posts:
    6
    When will Corgi be ready to work with Unity 2019.2b?

    Thank you!
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @TheAngryTophat > I'm not sure exactly what you mean, v5.5 already works fine on 19.2b.
    If you're asking if an update will require 2019.2b, then no, I don't do updates for beta versions. Too much stuff that changes, that's why it's a beta.
     
  24. Vodish

    Vodish

    Joined:
    Apr 23, 2018
    Posts:
    2
    Hey!

    Just tried the engine today, seems great! I just found two bug for now.

    If you open the inventory, when you close it you can still move the cursor even if you can't see it. So it is doing the noise all the time.

    When you're on a ledge, if you crouch it continuously spawn the dust effect that you have when you fall on the ground.

    I tried with Unity 2018.3.12f1 and 2019.1.0f2, the problem happens on both.
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @Vodish > If you think you've found bugs, please use the support email to report them, I'll be happy to have a look and send you a fix! I'll need a bit more info on how to reproduce the second one, I'm not aware of that issue and can't seem to repro it. The first one though has already been reported multiple times, and has been fixed for the next release already.
     
  26. Vodish

    Vodish

    Joined:
    Apr 23, 2018
    Posts:
    2
    Okay! I'll do that tomorrow, I didn't try to reproduce the crouch bug yet, I'll give more info tomorrow!
     
    reuno likes this.
  27. RolandoPT

    RolandoPT

    Joined:
    Jul 31, 2013
    Posts:
    15
    Hi, anyone got the engine working with a circle collider? wanted to make a circle player and round shapes to slide on...
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @RolandoPT > That's not a feature of the engine, and would require some heavy refactoring. I wouldn't recommend doing that using raycasts though, Unity's physics would be more suited for that.
     
  29. RolandoPT

    RolandoPT

    Joined:
    Jul 31, 2013
    Posts:
    15
    Ok thanks the fast answer.
     
  30. Asuraid

    Asuraid

    Joined:
    Jan 21, 2017
    Posts:
    2
    Hello, I was curious to ask if it possible to modify the retro stars to reset themselves to be false when the player dies, so it only keeps track of how many stars a player grabs through a full playthrough without any deaths -- alternatively, I was also wondering if it is possible to keep track of the stars grabbed between checkpoints (ex. I pick up 1 star, get to a checkpoint, grab a second star, then die -- the game would only keep the first star as having been picked up).

    One other thing that I can't quite figure out is why the boxes become 'stuck' to the player character and seem to be moved around by invisible objects, this gif is an example. It happened with the retro corgi controller as well, which this player was based on.

    EDIT: The box getting stuck to the player was fixed by making the box static once it hits the ground, but I'm not sure if it is normal for that box to do in general.
     
    Last edited: Jun 19, 2019
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @Asuraid > I've never seen these boxes behave like that. If you can reproduce that in any of the demo levels, please let me know how via the support email.
    As for modifying the retro star level, of course it's possible :)
    It seems to simply come down to saving at different times. Right now in the demo the save event is only triggered when you reach the end of the level, but that's something you'll want to change to match your own game rules.
     
  32. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    99
    @reuno
    Hello, about Melee mechanics: let's say I'll have some moves (punch, kick, something else...), is MeleeWeapon the right way? Maybe one MeleeWeapon per move?
    Then I need to call the single move via code, using button/key combinations or sequences: is there an example I could study in particular?
    Thankyou
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @luigi-freguglia > Yes, melee weapon is the right way, one per move.
    If you want, say, one button for kicks, one for punch, the easiest way to do that is to have two CharacterHandleWeapon components (technically a CharacterHandleWeapon and a CharacterHandleSecondaryWeapon). You can also make your weapons combo weapons of course.
     
  34. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    99
    @reuno Ok but what if I need more than 2 moves/weapons? I see in the API that you have CharacterHandleWeapon and CharacterHandleSecondaryWeapon, would it be simple to extend?
    Then, is it possible to bind the combo with directions too? For example down + hit + hit, or whatever.
    Thank you
     
  35. PeppersGamer

    PeppersGamer

    Joined:
    Jan 18, 2018
    Posts:
    17
    Similar to Siddiq's question. Do you have an example where you open an inventory using a mobile button? So i bind the inventory open method to a button. it opens the inventory but the game does not pause and the buttons wont select. This seems more complex than i first thought.
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @luigi-freguglia > CharacterHandleSecondaryWeapon being an actual example of how easy it is to extend this, I'd say yes :) As for directions, that's just a different input detection, so yes, if you override that, why not. Just check for more than one input.
    @PeppersGamer > That's because the "inventory open" method opens an inventory. There are also methods to pause the game if you want to also do that, you just need to call them too. If you bind your button to the InventoryInputManager's methods though, that's all handled for you.
     
    PeppersGamer and luigi7 like this.
  37. Miketysonjr

    Miketysonjr

    Joined:
    Mar 15, 2018
    Posts:
    23
    I got a problem. My character become invisible after i use checkpoint script .Everything else work fine , i still can control my character , make it run around , jump on anything, and the dirt animation still appear when it impact to the ground .... but it the character just wont show up itseft like i just use invisible magic . Lol
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @Miketysonjr > Have you checked the position of your character? Looks like either a sorting layer issue or your character is on the wrong z position.
    If the problem persists, please use the support form, and provide some details : how to reproduce in any of the demo scenes, what version of Unity, what version of the engine.
     
  39. saphira357

    saphira357

    Joined:
    Jun 22, 2019
    Posts:
    1
    Regarding the Advanced AI, I have an AI Enemy whose goal is to look for the player and fly towards him smoothly, non-linearly along some calculated curve and attack once in range. Since there will be multiple instances of this enemy, he should avoid overlapping his fellow mates. How can I accomplish this?
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @saphira357 > Create a custom flight action to implement that flight trajectory, and either in the action, or in a separate decision (depending on exactly how you want to structure your code), have it look for its flight mates and move in consequence.
     
  41. Miketysonjr

    Miketysonjr

    Joined:
    Mar 15, 2018
    Posts:
    23
    Oh my god, its really about z position , i change it from -38 to 1, and then it was showed up ... its so strange because there is only one raw layer and i didnt add any background or any other layer yet but by the way its worked ... thanks you so much , you really are an expert ....
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @Miketysonjr > You probably dropped your checkpoint and Unity assigned it a weird z based on your recent manipulations, or how you created the object. That puts it behind the camera, and thus it doesn't render on screen.
     
  43. polyconvex

    polyconvex

    Joined:
    Aug 17, 2018
    Posts:
    7
    Hello everyone!

    I'm using the Time Zone script to slow down time. When time is slower, the movement of everything is nice smooth slomo, but if there happens to be falling 2D physics rigidbodies in the scene, their slomo animation is very choppy/laggy. Maybe the same problem as here described: http://www.41post.com/4258/programming/unity-slow-motion-and-rigidbody-behavior

    I think it might have something to do with Time.fixedDeltaTime but I'm not sure. Has someone any advice and is it possible to get around this by extending the Time Zone script somehow for example? Cheers!
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @polyconvex > I can add support for that in the next release.
     
    Boom_Shaka and polyconvex like this.
  45. polyconvex

    polyconvex

    Joined:
    Aug 17, 2018
    Posts:
    7
    Oh sweet :--) Then I can focus on something else until the next release. You are awesome and thank you so much!
     
  46. shanemt

    shanemt

    Joined:
    Mar 5, 2014
    Posts:
    23
    Jumps often don't work when moving up a slope. Suppose you're walking up a slope to the right and you press jump. I think what's happening is that you move (right, up) from the jump, but in the next frame the raycast determines that you're touching the ground because the ground is also going up and to the right. The raycast reports back that you're grounded, and thus changes your state to being grounded. You can verify this easily in the MinimalSlopes Demo scene. Any solutions for this problem?
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @shanemt > If you think you've found a bug, please provide exact repro steps via the support form, as well as what Unity version and engine version you're using, thanks.
     
  48. shanemt

    shanemt

    Joined:
    Mar 5, 2014
    Posts:
    23
    I have another question. I made this 2D Platformer Pathfinding system for my old platformer before I began using the corgi engine. Now that I'm using the corgi engine, I'm trying to rebuild and improve that same system in the corgi engine. In order to accomplish the complex jumps/timings with my ai characters, I found it helpful to think of giving the ai characters a set of "inputs" in the same way that the player character received inputs. For instance, in a frame I might have an ai character be given a set of inputs like ("Space", "Shift", "D"). I'm having a hard time figuring out where I might insert something like that into the code for an ai character. Any help?

     
    Last edited: Jun 27, 2019
  49. TFGCo2

    TFGCo2

    Joined:
    Jun 10, 2017
    Posts:
    2
    Hey man, Im having troubles when building the project (without any mofications) for iOS with the Unity2018.4.2f1 and xcode 10.1
    I just keep getting this error "cannot user @try with objective-c exceptions disabled", on the KeychainAcessManager.mm. Ive changed the the objective-c try catch to a C++ try catch, and it builded! but this is not the solution Im looking for because Im not feeling safe to change the generated objective-c code to make it buildable.
    Do you have any clue about how to fix this?
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,922
    @shanemt > There are two ways (probably more) of doing that, either extend the input manager class and have your AI use that, or simply have your actions call each ability's public methods (that's how it's done right now).
    @TFGCo2 > I've never run into this issue before, so I'm not sure what the issue could be. It doesn't seem related to the engine though, looks more like a build issue, not sure what could cause this. Looking it up online it seems like a relatively common issue though, and this seems to be the most frequent answer : https://stackoverflow.com/questions...-objective-c-exceptions-on-xcode-4-2/11855447