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

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    33
    Hi @reuno,

    I have found that when using script Go To Level Entry Point character always faces right direction.

    In LevelManager.cs, RegularSpawnSingleCharacter() line 322 is forcing character facing direction to right, ignoring variable in Go To Level Entry Point for custom facing.

    I have solved updating the code:

    Old
    Code (CSharp):
    1. Players[0].RespawnAt(PointsOfEntry[point.PointOfEntryIndex], Character.FacingDirections.Right);
    New
    Code (CSharp):
    1. Players[0].RespawnAt(PointsOfEntry[point.PointOfEntryIndex], point.FacingDirection);
    I'm not pro developer... hope to have helped.

    Best!
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @gregacuna > Right click, remove script. These are leftovers from the post processing stacks, you can safely ignore them.
    @javi_unity402 > Thank you for reporting this! It's already been reported multiple times and fixed for the next release, but thanks a lot!
     
  3. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I'm having an issue with creating my character. I have used the Soldier3DBlue prefab as a template. I have got the new character animated where it will idle, walk, run, jump but only in one direction. Going right the character works just fine but when trying to go left the character is still facing right.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @gearedgeek > Without more context I'd guess it's something in your animator? But I have to admit I'm not sure how that could happen. Do the animator parameters still light up in the animator when going left? If yes, it's something in your setup, and I'd recommend looking at the many animator examples to see how it can be done. If not, then it's extremely weird, and I'd need more info. Drop me a line on the support form in that case.
     
  5. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I'm using this model (https://assetstore.unity.com/packages/3d/characters/humanoids/water-golem-golem-collection-52478) for the player. I have added the Soldier3DBlue prefab to the MinimalLevel. Then I add the golem model as a child under the Soldier3DBlue. I change the animator to match the Soldiers. Then disable the Solider model.

     

    Attached Files:

  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @gearedgeek > Again, please use the support form for support. But your animations seem to work fine whether you go left or right, your model is just not rotating... You need to let your Character component know what model it needs to rotate. I'd suggest reading the documentation, it explains character creation in great details.
     
  7. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    @reuno Email sent via Support form on your website.
     
    reuno likes this.
  8. Miketysonjr

    Miketysonjr

    Joined:
    Mar 15, 2018
    Posts:
    23
    hello reuno , im want to upgrade my weapon stats like rate of fires , damage, or health of character,... i saw there is weapon upgrade feature on homepage but i dont know where is it in the assest folders though i did try very hard to find ... can you tell me the name of scripts or what prefab sample had it in ,please ?
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Miketysonjr > Actually I completely forgot about the weapon upgrade when I updated the weapon system quite a few versions ago now, and you're the first person to mention it since :)
    So there's no such thing right now, I'll add that to the todo list, hopefully it'll be part of the next update.
    Thanks a lot for mentioning this!

    In the meantime, it can already be done quite easily. All you'd need would be a pickable item that targets your current weapon (for example) and changes its attributes.
     
    Mindjar likes this.
  10. Miketysonjr

    Miketysonjr

    Joined:
    Mar 15, 2018
    Posts:
    23
    could you tell me more detail about changes its attributes ? so i need to write my own code that changes the targeted weapon ? the pickable item script only had effect option that used for particle display ? so how do i target it to my weapon @@ ?
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Miketysonjr > Yes, that would mean write your own code. The easiest way to do that, as I said, would be to extend the PickableItem class, check if your character is holding a weapon, and change its attributes. Most of them are public already.
     
  12. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @reuno
    I want my player to be released from zipline when it reachs the end (as in Sonic 2)
    What will be the best way to approach this?

    Thanks
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Muppo > Changing your Character's state to anything but Gripping.
     
  14. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Sounds logic but, where should it be set, Zipline script or Grip script?
    I'm trying to figure it out but didn't success, yet
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Muppo > Both would work.
    I guess I'd put it on the zipline side.
     
    Muppo likes this.
  16. ramtamir

    ramtamir

    Joined:
    Feb 23, 2019
    Posts:
    18
    Hi. I've bought Corgi and Top Down, and have been really impressed with these assets. These are the first engine systems I've bought that actually justify the name engine. It wasn't much of a problem to figure many things on my own. One thing I do have troubles getting is the scoring. I've gone over the scenes that have score in them, but it's unclear how this is done. I've been going over some of the code, but since there's a lot of it I could really use some directions where to look. Thanks.
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @ramtamir > As explained in the documentation, score is handled and kept track of by the GameManager. You can trigger CorgiEnginePointsEvent to modify it (or use the public AddPoints and SetPoints methods, but that'll induce more coupling).
     
  18. TheAmusingFaust

    TheAmusingFaust

    Joined:
    Feb 2, 2019
    Posts:
    4
    Hello, I want my player to play an animation before flipping on the x axis, when I go left or right. I am not that experienced in coding so can anyone tell where I should start looking at for this?
     
  19. Ultrapp

    Ultrapp

    Joined:
    Aug 12, 2015
    Posts:
    27
    Hello!
    Please add more features for 2.5D.... is too basic.

    -Swimming
    -More Surfaces
    -Enemies (Includes Bosses)
    -Flight
    -Jetpack
    -Dangling
    -Weapons
    -Inventory
    -Collect a power and change shape (or several pieces to transform)
    -Driving vehicles

    ...Everything that now exists in 2D but in 3D please...
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @duruenesqr > As explained in the documentation, the Character's Flip method handles the flip of the character. In addition to that, every ability can override the CharacterAbility's Flip method, called (you guessed it) every time the character flips. So the easiest way to do what you're after would be to create a dedicated ability, that simply overrides Flip, and triggers your animation. You can see how to create your own abilities in the documentation.
    @Arieltm > Thats... already the case :)
    Every feature in the engine works exactly the same whether you use 2D or 3D assets. There are not necessarily demos of all features in both Ds, because it'd be pretty redundant, but you can achieve exactly the same things in both. That's the whole point of the engine.
     
    Ultrapp likes this.
  21. Svonsil

    Svonsil

    Joined:
    Jun 24, 2018
    Posts:
    13
    Hi, reuno! Can you explain how to create a bomb like on my video? I can't find nothing about this in documentation.
     
  22. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @reuno

    I was trying to add the autodrop feature on the zipline but I didn't success, would be nice if you can add it at the ToDo list.

    Thanks.
     
    Boom_Shaka likes this.
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Ferege > You can look at the grenades included in the asset for reference. Basically it's an animation/vfx and a DamageOnTouch area.
    @Muppo > Sure, no problem :)
     
    cjackcandy, Svonsil and Muppo like this.
  24. Svonsil

    Svonsil

    Joined:
    Jun 24, 2018
    Posts:
    13
    @reuno Hi! Is it difficult to make AI act like this? I'll be very happy, if you help me:D and thank you for helping with making a bomb ;)

     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Ferege > You'd need a new, dedicated decision for that, something like "DecisionBombWithinRange" or something. As for how difficult that is, that depends on your skills. I guess with the amount of Decision classes already included in the engine it shouldn't be too hard to come up with this one.
     
    Svonsil likes this.
  26. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    Would we use the PickableWeapon class to get the enemy to grab the bomb and wield it? I can see a use case where an enemy chooses either weapons or objects within a scene and uses them to attack the player.
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    Boom_Shaka likes this.
  28. Svonsil

    Svonsil

    Joined:
    Jun 24, 2018
    Posts:
    13
    Hello! I made an ai who swallows the bomb when he see it and dies. But whent it swallows it I get a error.
    NullReferenceException: Object reference not set to an instance of an object
    MoreMountains.CorgiEngine.DamageOnTouch.SelfDamage (Int32 damage) (at Assets/CorgiEngine/Common/Scripts/Agents/Damage/DamageOnTouch.cs:269)
    MoreMountains.CorgiEngine.DamageOnTouch.OnCollideWithDamageable (MoreMountains.CorgiEngine.Health health) (at Assets/CorgiEngine/Common/Scripts/Agents/Damage/DamageOnTouch.cs:244)
    MoreMountains.CorgiEngine.DamageOnTouch.Colliding (UnityEngine.Collider2D collider) (at Assets/CorgiEngine/Common/Scripts/Agents/Damage/DamageOnTouch.cs:190)
    MoreMountains.CorgiEngine.DamageOnTouch.OnTriggerEnter2D (UnityEngine.Collider2D collider) (at Assets/CorgiEngine/Common/Scripts/Agents/Damage/DamageOnTouch.cs:152)
    I made it using ai brain and damage on touch.
     
  29. gregacuna

    gregacuna

    Joined:
    Jun 25, 2015
    Posts:
    59
    Making progress and having fun learning and using Corgi. Thanks! Few questions:

    1. We're experimenting with the Corgi3D demo scene and have added our 3D character and started creating all the character animations, but we're having some unexpected problems:
      1. When the character runs into a regular wall (not a pushable item) it is going into the push animation and not the walk state like it does with your Corgi3D character. How do we change what parameter is triggered when the character hits a wall?
      2. Sometimes when the character jumps and hits a wall it seems to go into the wall and dies. Any ideas why that might happen?
    2. Our character seems to jump up and into the Level Bounds and then gets stuck in the sky instead of bouncing back. How can we fix that.
    3. When creating AI characters they are moving left/right, but with in IDLE and not WALK. What am I doing wrong?
    Thanks...hope you don't mind lots of questions. Have watched almost all your videos, but still will need some help along the way. Cheers!
     
    Last edited: May 15, 2019
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Ferege > I can't really guess what's wrong in your own script :) Usually double clicking on an error points you at the source of it though.
    @gregacuna > Please use the support form for support questions, thanks. And if you think you've found bugs, please provide steps to reproduce in any of the demo scenes, no changes made.
     
  31. NicoloTrapasso

    NicoloTrapasso

    Joined:
    Sep 23, 2016
    Posts:
    13
    Hi!
    How i can disable loadingscene?
    if i remove it from the build setting and press the start button in the startscene i get this error in the console:
    Scene 'LoadingScreen' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @NicoloTrapasso > Indeed, if you just remove it from the build, you'll get an error.
    Instead, replace calls to LoadingSceneManager with calls to the regular SceneManager API.
     
  33. NicoloTrapasso

    NicoloTrapasso

    Joined:
    Sep 23, 2016
    Posts:
    13
    Sorry, but i don't know how to do this. Can you explain me?

    Thanks
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @NicoloTrapasso > Throughout the engine, when a scene has to be loaded, this is done via the engine's LoadingSceneManager. If you don't want to use it, then you need to replace every call to the LoadingSceneManager with a call to Unity's native way of loading a scene, and that's SceneManager.
    So every time you see LoadingSceneManager, you simply remove the "Loading" part, and you're good to go.

    Alternatively, you can replace the LoadingSceneManager class with the one attached to this post, and you won't go through the loading scene anymore.
     

    Attached Files:

    Boom_Shaka likes this.
  35. NappingStarGames

    NappingStarGames

    Joined:
    Feb 20, 2019
    Posts:
    5
    Hi, everyone.
    Sorry for a noob question.

    I am struggling to find and change the points when I kill an enemy in Brobro Level(or any other demos that has points UI in the top right corner).
    As you play the demo games that have and point text in the top right corner you could see the points rising when you kill an enemy or get coins.
    The Coins itself has its own script to change given points by 'Points To Add', but the Enemies don't.
    I know that I need to make my own code to manage points but first I really need to know where are the points given when every time I kill an enemy.
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @ckgames-admin > As explained in more details in the documentation, points are handled by the GameManager. You can add points via its public methods, or by triggering a CorgiEnginePointsEvent. If you look at the Coin script for example, you'll see how it's done. It's a one liner.
    Code (CSharp):
    1. CorgiEnginePointsEvent.Trigger(PointsMethods.Add, PointsToAdd);
    And for enemies, this is handled through the Health component (PointsWhenDestroyed).
     
    CHEMAX3X likes this.
  37. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    21
    Hello
    i'd like to know if the loading scene currently help to load the next scene or it's just a visual effect ?
    Sometimes when i directly load a scene i have a little lag before the player can move
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @krisss666 > The loading scene loads the next scene and displays progress.
    As mentioned before you can either replace calls to it with regular SceneManager calls, or use the "light" class I posted in the post before yours.
     
  39. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    How could we get more precise collisions with a 3d model than the box collider can provide?
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @HeathC > That depends what for, without context it's a bit too vague :)
    Usually for platformers a box is enough, and the controller will only accomodate for that.
    If it's for hits, you could create more advanced hitboxes I suppose.
     
    HeathC likes this.
  41. phateRM

    phateRM

    Joined:
    May 1, 2018
    Posts:
    5
    Hi,
    I have been searching through the documentation but I was not able to find an answer. When jumping, correct me if I am wrong, it is possible to set the property JumpTimeWindow to implement a late jumping mechanics by setting the value to something bigger than zero. Is there a way to achieve a similar result when landing so that the player is forgiven for slightly short jumps, i.e. an "early landing" mechanics?

    Thanks!
     
  42. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    Basically I'm looking for a way to have more realistic collision with ledges, walls, etc. Right now if I run and hold running into a wall, parts of my character are in the wall, or, if I stand on a ledge, I can walk quite a ways off the ledge before falling. If I make the box collider bigger, I can get hit with damage/enemies before it looks like they are actually touching the model... Is there a way to make compound colliders or something that would allow to fix these? A standing character takes up less space visually than a running character... but the box is the same regardless...
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @HeathC > As I said, the controller will only work with boxes.
    Usually what you're after is handled outside of the controller, as it's just visuals.
    Depending on your tech stack the solutions for that vary a lot, but it usually implies IK and similar solutions.
     
  44. NicoloTrapasso

    NicoloTrapasso

    Joined:
    Sep 23, 2016
    Posts:
    13
    Thank you so much!!
     
    reuno likes this.
  45. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    Maybe you can resize it at runtime based on the character's current state? Just a thought.

    https://forum.unity.com/threads/changing-the-size-of-a-box-collider-at-runtime.200043/
     
  46. NappingStarGames

    NappingStarGames

    Joined:
    Feb 20, 2019
    Posts:
    5
    I've found PointsWhenDestroyed on Health script. Thanks!
     
    reuno likes this.
  47. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    21
    Maybe make the collider of the wall bigger so the player's collider hit the wall's collider before the player's sprite enter the wall's ?!
     
    Boom_Shaka likes this.
  48. Svonsil

    Svonsil

    Joined:
    Jun 24, 2018
    Posts:
    13
    Hello! I want to make object to fly away when colliding with other game object. How can I do it?
     
  49. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    29
    If it's rigidbody2D - https://docs.unity3d.com/ScriptReference/Rigidbody2D.AddForce.html
    But it depends what do you want to achieve. If you want an explosion effect use Point Effector:

    If you want to move corgi controller use damage on touch script and add Knockback Force.
     
    reuno and Boom_Shaka like this.
  50. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    29
    Here's a simple script I'm using in my game. I've added it to bullets.
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class AddForceOnCollision : MonoBehaviour
    6. {
    7.     public float magnitude = 100f;
    8.  
    9.     void OnCollisionEnter2D(Collision2D collision)
    10.     {
    11.      
    12.         if (collision.gameObject.tag == "movable")
    13.         {
    14.             Rigidbody2D rb = collision.collider.attachedRigidbody;
    15.             Vector3 force = transform.position - collision.transform.position;
    16.             force.Normalize();
    17.             rb.AddForce((-force + transform.up) * magnitude);
    18.         }
    19.     }
    20. }
    Just tag the object you want to move with "movable" tag.
     
    spaceJASE, Betzalel, mmn_tlh and 2 others like this.