Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v6.1 : auto scrolling levels, and more]

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

  1. Miketysonjr

    Miketysonjr

    Joined:
    Mar 15, 2018
    Posts:
    22
    Since i set vertical speed of parallax element as 1 , problem solved ... thanks you for reply !!!
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @Miketysonjr > I'm glad it's working now, thanks for letting me know.
     
  3. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    141
    I have noticed that the CharacterSwap will not work if you create a character into the scene. Apparently the Characters must be in the scene active in order CharacterSwap to work.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @gearedgeek > No, you can create them as well, but you have to tell the CharacterSwapManager that you did so, it's not gonna guess on its own, that'd ruin performance if it was performed at runtime.
     
  5. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    141
    Gotcha, I figured out the problem. I wasn't calling the UpdateList function before SwapCharacter. Now it's working. Thanks
     
    reuno likes this.
  6. laitr01

    laitr01

    Joined:
    Mar 6, 2019
    Posts:
    2
    Mindjar likes this.
  7. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    222
    @laitr01 , On the Character script, you have Initial Facing Direction set to Left, this setting must match character prefab facing side when created. Is the character created that way?
     
  8. laitr01

    laitr01

    Joined:
    Mar 6, 2019
    Posts:
    2
  9. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    222
    Have you tried different settings for Flip Model on Direction Change and Rotate Model On Direction? I know both this post and the last one sound like basic stuff but sometimes is just we forget to check a single option :)
     
  10. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    28
    @laitr01 - I had the same problem and it took me a while to figure that out. The solution is simple - You have to make the spine part of the character as a child of Corgi character. So You have to separate the animation part from the logic.
    I assume from the screenshots that You've done that?
    I think You've forgot to set the Character Model in Character Script to Spine Gameobject (zombie03).
    This part takes the Spine model and flips it leaving the base Gameobject intact.
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @laitr01 > As @Mindjar said, you probably have to nest your model properly (as explained in the documentation). If that doesn't solve it, please provide more info, as I recommended to you via email yesterday :)
     
  12. KriYorDev

    KriYorDev

    Joined:
    Oct 3, 2017
    Posts:
    29
    Is there a way to have a direction change animation in Unity? I am not even sure if it's a Corgi Engine related question. I was thinking of having an animation on how my character flips direction when moving left or right. Like bending the knees or something that stop the inertia. The normal flipping works fine and well for me right now though.
    I am aware it can probably be done with skeletal animation, but I need it for a sprite-based one. Just looking for some feedback on the idea.

    Thank you!
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @KriYorDev > If you're using spritesheets I guess the easiest way to do it would be to draw a "change direction" animation?
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    Hey, good news everyone, the beta release for v6.0 of the Corgi Engine is ready, and I'm about to start the beta test for it early next week. If you want to participate in that beta test, please send me a message via the support form (https://corgi-engine.moremountains.com/corgi-engine-contact) with your invoice number. I'll send you a NDA for you to sign, you sign it, send it back, and I'll send you a link to download the update. If you're already part of the beta testers, just mention it in your message, no need to sign anything again of course. Note that this beta requires 2019.2. Here are the beta release notes :

    ✨ Adds the CinemachineCameraController class that provides native support for Cinemachine. All Retro and RetroAdventure demos now use Cinemachine
    ✨ Adds PickableActions, a new type of pickable items that triggers actions when picked
    ✨ Adds the ButtonActivator class, that you can put on any objects to activate ButtonActivated classes (that no longer necessarily require a Character), allowing for many puzzle creation options
    ✨ Adds the AppearDisappear class, that lets you create objects on an appearing / disappearing cycle, usually platforms but can be used for anything, and an example of that at the start of the RetroForest demo scene.
    ✨ Adds the MMFaderRound class, a new way to transition between scenes, made famous by Mario games
    ✨ Adds post processing volumes and layers to most scenes (still completely optional).
    ✨ Adds built-in support for MMFeedbacks, a super easy way to add all sorts of feedbacks (visual, sound, animations, particles, transform based, post processing, screenshakes, etc)
    ✨ Adds MMFeedbacks (and replaces legacy and limited sfx or particles triggers) for Health, DamageOnTouch, Weapons, ButtonActivatedZones, PickableItems, Teleporters, Jumpers and Character abilities. Need feedbacks anywhere else? Drop me an email, I'll be happy to add more.
    ✨ Adds a prefab finder in the editor, letting you find prefabs with missing scripts or prefabs of a certain type (useful if you want to port an old project to the MMFeedbacks system)
    Adds support for stompable in multiplayer games, and an example of that in the Minimal4Players demo scene
    Adds a TargetOffset to AIActionShoot, allowing you to control more finely how AI characters aim at targets
    Adds more options to the MMFPSUnlock component
    Button Activated Zones can now self-disable after their last use.
    Improves button prompts, better architecture and performance, and can't get stuck mid way when entering / exiting a zone quickly anymore
    Adds the Airborne animation parameter, a boolean that gets true when your character gets higher than a customizable height
    Adds a customizable ComboInProgress animation parameter to combo weapons
    Improves ButtonActivated zones by adding more action requirements options, bindable actions on activation, exit and stay, and native MMFeedbacks support.
    Adds more options for key bindings to InventoryInputManager
    Adds an option for moving platforms to start (and keep) moving when a player collides with them, even if the player exits the platform afterwards.
    Adds input buffering to CharacterHandleWeapon, allowing for easier chained attacks.
    Adds scale clamps to MMSquashAndStretch, and adds Squash and Stretch behaviour to the RetroCorgi demo character
    Adds a new animator for the RetroCorgi character, showcasing a different and more traditional way of setting up animations and transitions
    Animation parameter strings are now hashed
    ComboWeapon's ResetCombo method is now public to allow for combo cancel from external abilities
    MMTimeManager now also modifies delta time values to match the new timescale, improving rigidbodies behaviour
    Adds public bounds dimensions getters to CorgiController
    Moves a small value distance check in the CorgiController that increases accuracy at a small cost
    Improves the accuracy of the controller's stick to slope feature
    Caches a few references across the board for performance
    CharacterAbility's StopAbilityUsedSfx() is now public
    Adds native support for MMFeedbacks for Weapons
    Adds better fade control across the board (finer control over curves, timescale, etc)
    Adds the SetTransform method to CorgiController, a way for abilities to move the controller "safely" to a new position
    Fixes a bug that could cause erroneous weapon placement when using rotating models, nested weapon attachments and picking weapons from the right
    Fixes a bug that would result in the incorrect force being applied when walljumping input independently on certain walls
    Removes missing scripts from (very) old prefabs
    Fixes the comments of the Hittable class.
    Fixes a typo in ButtonActivated's UnlimitedActivations
    Prevents a bug that could cause items on a path to be dropped at the wrong position
    Prevents a weapon from still applying a movement modifier after having been destroyed
    Fixes a typo in MMInput
    Prevents a bug that could cause inventory screens from being interactable when hidden under a certain setup
    Fixes a typo in the LevelSelection scene
    Fixes a bug that could prevent properly displaying melee weapons gizmos
     
  15. RolandoPT

    RolandoPT

    Joined:
    Jul 31, 2013
    Posts:
    15
    Hi, I made a pickable item that changes the number of jumps in the Jump component. Is there a build in way to not reset the values after respawning? If I die I can't double jump anymore.
     
    Last edited: Aug 8, 2019
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @RolandoPT > It's up to you to store that value and re-assign it whenever you need/want.
     
  17. RolandoPT

    RolandoPT

    Joined:
    Jul 31, 2013
    Posts:
    15
    Yes I know, just wanted to ask if there is a setting for that since the permitted value from the abilities doesn't reset on respawn.

    Thanks for the answer. Great support like always.
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @RolandoPT > No, there's nothing automatic for that, I prefer letting that up to the user's decision to accomodate for all possible use cases. If it was automatic it'd get in the way of too many things.
     
  19. Grafos

    Grafos

    Joined:
    Aug 30, 2011
    Posts:
    219
    Hi reuno, great news about v6. Do you have any update on adding pre/post jump functionality to characters, as you mentioned you would add it several versions ago?
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @Grafos > It's still in the backlog. If more people request it, it'll get higher on the todo list, like every other request :)
     
    Grafos likes this.
  21. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    222
    Then it have my vote as well :)
     
    Grafos and reuno like this.
  22. htkt208

    htkt208

    Joined:
    Jun 29, 2018
    Posts:
    2
    Hey reuno, I apologize for my pretty bad English.
    Dash in Corgi Engine distance is not the same between each dash.
    Is there any way to apply the distance for dash instead of using force?
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @htkt208 > That shouldn't be the case, dash is distance based.
    Please use the support form and provide more details about your issue.
     
    htkt208 likes this.
  24. htkt208

    htkt208

    Joined:
    Jun 29, 2018
    Posts:
    2
    Thank you for the quick reply. Maybe I should set Dash Force to lower.
     
  25. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    141
    @reuno I have came across this error when I have the Character Push Corgi Controller component on one of my characters. I noticed the error appears when the Character Type is selected as AI. But when it's set to Player the error doesn't appear.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. MoreMountains.CorgiEngine.CharacterPushCorgiController.ProcessAbility () (at Assets/CorgiEngine/Common/Scripts/Agents/CharacterAbilities/CharacterPushCorgiController.cs:57)
    3. MoreMountains.CorgiEngine.Character.ProcessAbilities () (at Assets/CorgiEngine/Common/Scripts/Agents/Core/Character.cs:321)
    4. MoreMountains.CorgiEngine.Character.EveryFrame () (at Assets/CorgiEngine/Common/Scripts/Agents/Core/Character.cs:273)
    5. MoreMountains.CorgiEngine.Character.Update () (at Assets/CorgiEngine/Common/Scripts/Agents/Core/Character.cs:260)
    6.  
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @gearedgeek > I don't reproduce that error on the few AIs I just tested on. I'd need more info, please use the support form and provide exact repro steps from any of the demo scenes, along with Unity version, asset version, etc, thanks.
     
    gearedgeek likes this.
  27. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    141
    Support Request has been submitted.
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @gearedgeek > Thanks for the additional info, answered you via email.
    Just in case anybody else does the same mistake : don't check "button based" on AI abilities. AIs don't press buttons, and this will throw an error, that's normal.
     
  29. Betzalel

    Betzalel

    Joined:
    Dec 3, 2017
    Posts:
    17
    add my vote as well!
     
    Grafos and reuno like this.
  30. LOGames

    LOGames

    Joined:
    Sep 4, 2016
    Posts:
    19
    @reuno I'm having an issue with scene fading. In a new project with just corgi installed (2019.2) no scenes fade in. Fading out at the end of a level seems to work but then the next thing loaded will just pop on, and not fade.
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @LOGames > Please use the support form if you think you've found a bug, and provide repro steps, thanks.
     
  32. Asuraid

    Asuraid

    Joined:
    Jan 21, 2017
    Posts:
    2
    Hello! I have come back again, there's much progress that has been done since about two months ago, this is a non-finalized version of the game.

    I do have another question since we're reaching into the polish stage and don't quite have a good idea how to approach this problem; stars at the moment stay collected even if the player dies, the way we'd like it to be is that stars only stay collected once you hit a checkpoint or the end of the level (of course, quitting a level mid-way wipes all the progress of the stars so checkpoints wouldn't be a "permanent" save).

    Example, there is a checkpoint in the game and two stars; one star is between the start and checkpoint #1, the other is after checkpoint #1. If the player grabs star #1 but dies before hitting checkpoint #1, the star isn't saved as collected, but if they hit the checkpoint, it registers it as collected, even if they die further on in the level -- as long as they hit the checkpoint and collected the star, they have it. Same would go for star #2, if they collect it and die, the game doesn't register it as collected (but still remembers that star #1 was collected earlier).

    We're just not sure how to tell the scripts to remember which stars were collected when checkpoints are hit. We might have an idea how to approach it but we'd thought to ask you to see if there is a more efficient and clean way to go about it.

    EDIT: We actually did solve it in a short and sweet way by using two lists; one is a temporary list that keeps all the IDs of the stars until it hits a checkpoint, then transfers the integers of the star IDs to a permanent list before wiping itself clean for the next collection of IDs. The permanent list holds onto all the collected integers, and for each integer in it, it runs the function that was originally located on the "Pick" of the stars.

    The StarID is received from the Star parent class. On a side note, the HuskyPluginManager is just a script that handles sending messages to other scripts.

    RetroStar.cs
    Code (CSharp):
    1.  
    2. public class RetroStar : Star
    3.     {
    4.         /// <summary>
    5.         /// On Start we disable our star if needed
    6.         /// </summary>
    7.         protected override void Start()
    8.         {
    9.             base.Start ();
    10.             DisableIfAlreadyCollected ();
    11.         }
    12.         /// <summary>
    13.         /// Disables the star if it's already been collected in the past.
    14.         /// </summary>
    15.         protected virtual void DisableIfAlreadyCollected ()
    16.         {
    17.             foreach (RetroAdventureScene scene in RetroAdventureProgressManager.Instance.Scenes)
    18.             {
    19.                 if (scene.SceneName == SceneManager.GetActiveScene().name)
    20.                 {
    21.                     if (scene.CollectedStars.Length >= StarID)
    22.                     {
    23.                         if (scene.CollectedStars[StarID])
    24.                         {
    25.                             Disable ();
    26.                         }
    27.                     }
    28.                 }
    29.             }
    30.         }
    31.         /// <summary>
    32.         /// Disable this star.
    33.         /// </summary>
    34.         protected virtual void Disable()
    35.         {
    36.             this.gameObject.SetActive (false);
    37.         }
    38.         protected override void Pick()
    39.         {
    40.             // we send a new star event for anyone to catch
    41.             //CorgiEngineStarEvent.Trigger(SceneManager.GetActiveScene().name, StarID);
    42.             HuskyPluginManager.instance.m_StarManager.AddToTempList(StarID);
    43.         }
    44.     }
    45.  
    StarManager.cs
    Code (CSharp):
    1.  
    2. public class StarManager : MonoBehaviour
    3. {
    4.     public List<int> TempList;
    5.     public List<int> FinalList;
    6.     private void Start()
    7.     {
    8.         TempList = new List<int>();
    9.         FinalList = new List<int>();
    10.     }
    11.     // Add a star id to templist
    12.     public void AddToTempList(int id)
    13.     {
    14.         TempList.Add(id);
    15.     }
    16.     // Clear the temp list
    17.     public void ClearTempList()
    18.     {
    19.         TempList.Clear();
    20.     }
    21.     // This is called after checkpoints or on level completion, add templist to final list
    22.     public void FinalizeTempList()
    23.     {
    24.         foreach(var id in TempList)
    25.         {
    26.             FinalList.Add(id);
    27.         }
    28.         ClearTempList();
    29.     }
    30.     // This is called on level complete, register all stars in the final list
    31.     public void FinalizeAllStars()
    32.     {
    33.         foreach(var id in FinalList)
    34.         {
    35.             CorgiEngineStarEvent.Trigger(SceneManager.GetActiveScene().name, id);
    36.         }
    37.     }
    38. }
    39.  
    The game then recognizes the stars that have been collected properly. The public functions are all called in different places, temp ones are called on the pick function in the stars, the function to transfer from temp list to permanent list is at the checkpoint, and the finalizing happens on the gate to the next level.
     
    Last edited: Aug 13, 2019
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @Asuraid > That sounds like a good way of doing that, thanks for sharing this!
     
  34. Negrat

    Negrat

    Joined:
    Oct 1, 2013
    Posts:
    9
    Hi Reuno, the new feedback system sounds cool.
    I have one question: will we be able to add multiple feedback components to the same ability?
    For example, one for the start of the jump and another for the end of the jump.
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @Negrat > This is exactly how it works :)
    Every ability (barred a few exceptions) get two feedbacks : AbilityStartFeedbacks and AbilityStopFeedbacks, that get triggered when the ability starts and stops. Of course all abilities can also declare extra feedbacks (Character has "just Touched the ground" feedback, for example).
    The cool thing with that is that you can use the StartFeedbacks to play stuff once, at the start, or have a feedback for the duration of the ability, as they get stopped on Stop.

    So out of the box you can have the following behaviour for, let's say, the Run ability :
    - dust explosion on start
    - "let's go" sfx when you start running
    - dust behind your character as it runs
    - fast footsteps sound as it runs
    - opposite direction explosion when you stop

    And with something like 30 different feedbacks available, some of them quite complex, there's no limit to what you can do :)
     
  36. Fabioisriva

    Fabioisriva

    Joined:
    Feb 3, 2016
    Posts:
    15
    finally a proper native cinemachine integration ;) looking forward official release
     
    reuno likes this.
  37. andrin_man

    andrin_man

    Joined:
    Mar 9, 2014
    Posts:
    6
    I recently added the lightweight render pipeline to my project in order to test out the new 2D lights and noticed when I did this the interaction between the UI camera and the main camera was lost. The UI camera overrides the main camera such that the level and gameplay is not visible as if the canvas the UI is on is opaque. If I turn off the UI camera the main camera is visible again but of course the UI will not be. I can not find a work around for this and it resolves if I remove the LWRP from the project. This occurs in my own levels as well as the example levels provided.

    Any thoughts?

    Using 2019.2.1f1 and Corgi 5.4
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
  39. luigi73

    luigi73

    Joined:
    Jun 30, 2015
    Posts:
    46
    I have a working prototype about this ability actually now: tried to stay inside corgi architecture writing another ability, starting from dash ability and adding the suck part, not very difficult but tricky (when the code will be better to read, i'll share it). Basically it begins as a normal dash (with a distance, cooldown...), if the player meets a suckable object stop the dash and begins the suck part where the two characters cant move until the suck ends (you have to keep an input push frequency to suck or the suck ends and the player is knocked back).
    About the damage part, there is a melee weapon that gets activated 1+ times at given intervals, and everything works extending the characterhandleweapon ability.
     
    reuno likes this.
  40. wayloon

    wayloon

    Joined:
    Oct 2, 2015
    Posts:
    3
    Hi @reuno, I have a question, I pause the game by pressing the ESC button in the RetroAI scene. Wait about 30 seconds and then press ESC to cancel the pause.Can see that the game won't run right away.


    The version I am using is Unity 2019.2.1f1,The version of CorginEngine is v5.5.
     
    Last edited: Aug 22, 2019
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @wayloon > Looks like a Unity physics spike. Apparently it's a (not well) known issue with rigidbodies and zero timescale. I'll dig into it, but I'm not 100% sure it's something I can fix on my side. Thanks for reporting this.
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @wayloon > Seems to come from the tilemap platforms rigidbody, which is sadly required by the CompositeCollider. The engine itself doesn't rely on rigidbodies so I was wondering why it happened. Now I know :) I'll see if there's anything I can do about it. If you replace it with regular colliders, coming back from pause is instant.
     
  43. wayloon

    wayloon

    Joined:
    Oct 2, 2015
    Posts:
    3
    Hi @reuno ,Thank you for finding the problem so quickly. I also use Tilemap in my project. Can I solve this problem without giving up the tilemap? This demand sounds quite troublesome:D.
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @wayloon > It's an issue outside of the scope of the engine. I don't know if Unity would consider that a bug or not, but they're the ones you should ask. The only solution I've found is to replace the tilemap collider with something else (handmade or computed "normal" colliders that don't have to rely on a rigidbody).
     
  45. wayloon

    wayloon

    Joined:
    Oct 2, 2015
    Posts:
    3
    @reuno, I understand. I will go to consult the official members of Unity.If not, I will follow your advice. You still solved my problem,Thank you again for your help !
     
    reuno likes this.
  46. Meowx

    Meowx

    Joined:
    Oct 10, 2015
    Posts:
    24
    5.5 to 6.0, that's quite the jump!

    Do we have a way to extend CharacterStates.cs yet, or is that still on the to-do list?

    Keep up the great work!!
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @Meowx > No, I don't believe there is an easier and more convenient way of doing it right now without raising the bar too high for newcomers.
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    Good news everyone, I've just pushed v6.0 of the Corgi Engine to the Asset Store!

    It's a major update, that comes with a ton of new features, enhancements to existing features, as well as, as usual, bug fixes for all known bugs to date.

    A few major things to note :

    - this version requires 2019.2. If you're on an older version of Unity, it's probably possible to update, but you'll have to manually grab the install from 2019.2, copy the files to your old folder, and deal with the possible conflicts (which, depending on what version you're at, could be non existent or many).

    - this version is the first of the Corgi Engine to depend on Unity packages, just like the TopDown Engine before it. This adds an extra, manual step to the install process. If you follow the documentation or readme, that's one copy paste in the explorer, so it should be relatively easy :) Let me know if you run into issues with that.

    - this version completely changes the way the abilities (and health, and a few other things) trigger sound effects and particles. It's all now centralized in the much more powerful MMFeedbacks system. This means that all previously setup sfx and particles will have to be setup again. That's a drag and drop away, but if you have a lot of stuff, this may be a tedious task. I've had to do that for 60+ demo scenes and almost as many characters, it wasn't necessarily a fun morning. But it comes with so much added potential that I think it's worth it. This is by far the most "breaking" change, the rest should be relatively painless if you choose to udpate. But whatever you do, please, make a backup first (or better, use version control).

    Here are the full release notes. As usual, expect a few days of delay before the update hits the store. I hope you'll like it as much as I do!

    - Adds the CinemachineCameraController class that provides native support for Cinemachine. All Retro and RetroAdventure demos now use Cinemachine
    - Adds PickableActions, a new type of pickable items that triggers actions when picked
    - Adds the ButtonActivator class, that you can put on any objects to activate ButtonActivated classes (that no longer necessarily require a Character), allowing for many puzzle creation options
    - Adds the AppearDisappear class, that lets you create objects on an appearing / disappearing cycle, usually platforms but can be used for anything, and an example of that at the start of the RetroForest demo scene.
    - Adds the MMFaderRound class, a new way to transition between scenes, made famous by Mario games
    - Adds post processing volumes and layers to most scenes (still completely optional).
    - Adds built-in support for MMFeedbacks, a super easy way to add all sorts of feedbacks (visual, sound, animations, particles, transform based, post processing, screenshakes, etc)
    - Adds MMFeedbacks (and replaces legacy and limited sfx or particles triggers) for Health, DamageOnTouch, Weapons, ButtonActivatedZones, PickableItems, Teleporters, Jumpers and Character abilities. Need feedbacks anywhere else? Drop me an email, I'll be happy to add more.
    - Adds a prefab finder in the editor, letting you find prefabs with missing scripts or prefabs of a certain type (useful if you want to port an old project to the MMFeedbacks system)
    - Adds the CharacterDetector class that lets you know and trigger events when characters (and players) enter/stay/exit an area
    - Adds support for stompable in multiplayer games, and an example of that in the Minimal4Players demo scene
    - Adds a TargetOffset to AIActionShoot, allowing you to control more finely how AI characters aim at targets
    - Adds more options to the MMFPSUnlock component
    - Button Activated Zones can now self-disable after their last use.
    - Improves button prompts, better architecture and performance, and can't get stuck mid way when entering / exiting a zone quickly anymore
    - Adds the Airborne animation parameter, a boolean that gets true when your character gets higher than a customizable height
    - Adds a customizable ComboInProgress animation parameter to combo weapons
    - Improves ButtonActivated zones by adding more action requirements options, bindable actions on activation, exit and stay, and native MMFeedbacks support.
    - Adds more options for key bindings to InventoryInputManager
    - Adds an option for moving platforms to start (and keep) moving when a player collides with them, even if the player exits the platform afterwards.
    - Adds input buffering to CharacterHandleWeapon, allowing for easier chained attacks.
    - Adds scale clamps to MMSquashAndStretch, and adds Squash and Stretch behaviour to the RetroCorgi demo character
    - Adds a new animator for the RetroCorgi character, showcasing a different and more traditional way of setting up animations and transitions
    - Animation parameter strings are now hashed
    - ComboWeapon's ResetCombo method is now public to allow for combo cancel from external abilities
    - MMTimeManager now also modifies delta time values to match the new timescale, improving rigidbodies behaviour
    - Improves the way items get added to the inventory when existing items are already present
    - Adds public bounds dimensions getters to CorgiController
    - Moves a small value distance check in the CorgiController that increases accuracy at a small cost
    - Improves the accuracy of the controller's stick to slope feature
    - Caches a few references across the board for performance
    - CharacterAbility's StopAbilityUsedSfx() is now public
    - Health now forces any delayed destruction to cancel for added safety
    - Adds native support for MMFeedbacks for Weapons
    - Adds better fade control across the board (finer control over curves, timescale, etc)
    - Adds the SetTransform method to CorgiController, a way for abilities to move the controller "safely" to a new position
    - Fixes a bug that could cause erroneous weapon placement when using rotating models, nested weapon attachments and picking weapons from the right
    - Fixes a bug that would result in the incorrect force being applied when walljumping input independently on certain walls
    - Fixes a wrongly setup xbox axis
    - Fixes a few dash plus looking up related bugs
    - Removes missing scripts from (very) old prefabs
    - Fixes the comments of the Hittable class.
    - Fixes a bug that would happen when jumping down a 1way platform while WallClinging was set to InputIndependent
    - Fixes a bug that would cause a wrong wall jump when InstantAcceleration was active.
    - Fixes a typo in ButtonActivated's UnlimitedActivations
    - Prevents a bug that could cause items on a path to be dropped at the wrong position
    - Prevents a weapon from still applying a movement modifier after having been destroyed
    - Fixes a typo in MMInput
    - Prevents a bug that could cause inventory screens from being interactable when hidden under a certain setup
    - Fixes a typo in the LevelSelection scene
    - Fixes a bug that could prevent properly displaying melee weapons gizmos
     
  49. RandomSpell

    RandomSpell

    Joined:
    Nov 30, 2018
    Posts:
    12
    I'm trying to enable the CharacterHandleWeapon script using the following code but I'm not having any luck.

    Could someone tell me what I'm doing wrong? Also, would this be the best way to enable/disable a script?

    Thanks

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using MoreMountains.Tools;
    5.  
    6. namespace MoreMountains.CorgiEngine
    7. {
    8.  
    9.     public class EnableWeaponScript : MonoBehaviour
    10.  
    11.     {
    12.         private CharacterHandleWeapon Weapon;
    13.  
    14.         void Start()
    15.         {
    16.             Weapon = GetComponent<CharacterHandleWeapon>();
    17.             Weapon.enabled = false;
    18.         }
    19.  
    20.         void OnTriggerEnter2D(Collider2D target)
    21.         {
    22.             if (target.tag == "WeaponZone" && Weapon.enabled == false)
    23.             {
    24.                 Weapon.enabled = true;
    25.             }
    26.         }
    27.        
    28.     }
    29. }
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,155
    @RandomSpell > Without even knowing what's not working it's hard to tell.
    I'd recommend doing that the other way around. You usually want to put zone specific scripts on the zone, not on the character. You'll find plenty of examples of that in the engine.