Search Unity

  1. Unity 2019.2 is now released.
    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. matttardiff

    matttardiff

    Joined:
    Feb 27, 2018
    Posts:
    15
    Cool. That's what I wanted to know so I didn't waste more time trying to figure it out
     
  2. HCrowley

    HCrowley

    Joined:
    Oct 16, 2013
    Posts:
    18
    yeah, i can see that the length of the animation probably doesn't factor into the equation, i was just trying to reduce the problem to its barest minimum. in fact i've reduced it even further, to a point where i've set up a test scene that isn't using the Corgi Engine at ALL, and i still can't get the stoopid animation to fire consistently

    so, because i want to move on with the project (and my life), i've replaced the melee weapon with a firing one. that doesn't fix the underlying problem of the animation sometimes not playing, but it does at least mean that when the player presses fire, he gets some visual feedback that he's instigated an attack - which makes the absence of the accompanying animation not quite so glaringly obvious
     
    reuno likes this.
  3. Glytchy

    Glytchy

    Joined:
    Feb 8, 2016
    Posts:
    5
    In my game I want the player to have 2 weapons equipped at once on different inputs, similar to the Megaman Zero series. specifically a projectile/hitscan weapon attributed to one hand and a melee(with combos) attributed to the other hand (though the animation with use both hands). Can a single CharacterHandleWeapon handle this scenario or will i need a second? If not, how would i set up the second CharacterHandleWeapon to handle the secondary weapon?
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Glytchy > You can use the CharacterHandleSecondaryWeapon ability for that, which, as explained in the documentation, does exactly what you're after :)
     
  5. Glytchy

    Glytchy

    Joined:
    Feb 8, 2016
    Posts:
    5
    @reuno I seem to not be able to find a mention of this scripton the page for weapons, but now that I know it is an option I should be able to find a solution. Thank you.
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Glytchy > It's an ability, you'll find it in the abilities documentation (and of course in more details in the API documentation).
     
    Glytchy likes this.
  7. Glytchy

    Glytchy

    Joined:
    Feb 8, 2016
    Posts:
    5
    @reuno That would have been my mistake then. Thank you again for pointing me in the right direction.
     
    reuno likes this.
  8. tobiasparrow

    tobiasparrow

    Joined:
    Jul 19, 2012
    Posts:
    40
    @reuno Hey! I am interested in your 2D Platformer asset. I simply want a tight controller that moves constantly to the right and when I tap, I jump.

    Also will have the ability to change the player with a tap (this will be just turning off a sprite with its collider and turning another one on while the player controller is on the parent game object) so for example, I will have to change the gravity, move speed, jump height on the fly.

    Example for above: root > player1 with collider / player 2 with collider / player 3 with collider. Player 1 gameobject will be enabled while the others disabled until I click switch. This wouldn't mess with your character controller, will it? Only thing I can think of is something to do with the collider if your using ridigbody2d.cast?

    Also, for triggering, right now I just have a rigidbody2d with kinematic set so I can use isTrigger. Would I do the same thing with your asset? Just have the player controller script on the player and the Rigidbody2D set to kinematic?

    Does your controller do this? (I am assuming it can but I have to ask as I have bought assets before and have been burned.)

    Also, that is the only functionally I want. I don't want to bulk up my project with unneeded stuff. Is it easy to remove everything I don't need such as your advanced AI system, enemies, the inventory system etc...

    Thanks! Can't wait to use it :)
     
    Last edited: Apr 18, 2019
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @tobiasparrow > There's no built-in "move constantly to the right" (it's on the todo list though), but that's easy enough to implement on your side.
    You get many options to swap players at runtime, whether it's just appearance, or more complex full prefab changes.
    You also get triggers of course, using Unity's built-in colliders.
    As for removing stuff, it's doable at your own risks. If you know what you're doing it's relatively easy, although I'd advise against it, it's usually bad practice to strip libraries, the parts you don't use don't affect your performance or build size in Unity, so there's not much to gain from it aside from potential bugs.
    I'd still suggest you look at the feature list and documentation and decide for yourself if it's a good fit or not for what you have in mind :)
     
  10. Stilghar

    Stilghar

    Joined:
    Feb 4, 2013
    Posts:
    76
    Hi, I have a question I can't find answered anywhere. I am using the Corgi Engine and from what I can see the wall jump requires the player to be first wall clinging (so pressing in the direction of the wall you want to wall jump from). The problem is that if you want to jump like in the gif (fast wall to wall jumps to go up).


    corgi-walljump.gif

    Going from a wall to the opposite requires changing directions in the controller very fast and it is counter-intuitive. So, is there a way for the character to wall jump when it is next to a wall but without the need to wall cling first?
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Stilghar > I would argue that counter intuitive in this context is debatable considering the amount of games that do it exactly like that :)
    But it's easy to fix, just extend the WallClinging ability so that the conditions for it are just based on proximity and not input direction to implement your specific rules, and you're good to go.
     
    Quinn221 likes this.
  12. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    215
    I tried myself to extend the ability to behave in a way it does only need to press jump button and player goes from wall to wall unless you stop clinging or jumping. Didn't success. I'm almost sure all I need to modify is lines 62 and 63 on the CharacterWallClinging script, just don't know exactly what to set there.

    Also some other user asked about this feature sometime ago, can't remember if I voted for it or not but, I would love to see this in a future update aswell :)

    PS: CreateNewPrefab.cs shows minor issues on console, Unity 2018.3.11f1
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Muppo > The "simple" wallclinging is on the todo list (has been for a while), but it's only got a handful of votes. I'll push it up a bit, it's really not too hard to implement, but it's easy to push in an update.
    And I've removed the CreateNewPrefab class altogether from the next update, it's useless anyway :)
     
  14. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    215
    Thanks @reuno.
    I'll try again a few days later, maybe I was just not enough focused on code lately.
     
  15. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    28
    I have a question about Grip ability behaviour. No matter how small I set the Buffer Duration After Grip value the character can't jump and attach from one grip object to another without first touching the ground. Is this intended?
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Mindjar > No, that was a recently introduced bug, it's been reported a lot, and fixed for the next release.
    Don't hesitate to use the support form next time to report a bug, way easier to keep track for me, and that way I can even send you the fix.
     
  17. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    28
    Thanks, next time I'll email You :)
     
    reuno likes this.
  18. Kelgand

    Kelgand

    Joined:
    Feb 3, 2018
    Posts:
    10
    @Muppo @reuno There may be a bug related to air movement that is making wall jumping without a direction pressed a little more difficult than it should be, I just haven't gone through to confirm if it is happening to the demo levels/base engine or only my own scenes yet. As there is some interest in wall jumps right now, I can check it out when I get off of work today.

    This is what I am doing for my game where I will not have double jumps, so I don't have to worry about whether to use a regular air jump or override it with a wall jump. In the wall jumping ability, you should only need to change

    Code (CSharp):
    1. // if we're here the jump button has been pressed. If we were wallclinging, we walljump
    2. if (_movement.CurrentState == CharacterStates.MovementStates.WallClinging)
    To:

    Code (CSharp):
    1. // if we're here the jump button has been pressed. If we were wallclinging, we walljump
    2. if (!_controller.State.IsGrounded && (_controller.State.IsCollidingRight || _controller.State.IsCollidingLeft))
    It's pretty simple, if you're colliding left or right and not on the ground, then you should be able to wall jump. This gets around needing to have wall clinging, and if you are touching the wall then it does work and will push you off when you press the jump button. I went through a few iterations of figuring out what kind of air movement I wanted in my game, which is how I found the potential bug. If you have SpeedAccelerationInAir set to zero (or a very low number so that you don't immediately stop when you aren't pressing a direction), then when you jump off the wall you will keep going until you hit something or the ground. If you hit another wall, then you should be able to jump again. In practice, I found that my character would stop *just* (tens of thousandths of a unit) before the wall, so I wasn't considered colliding with it. When I hit the ground, I could then press a direction to move those remaining tens of thousandths of a unit into the wall, become colliding with it, and then jump upwards and press jump again in the air to wall jump without pressing a direction.

    The bug was repeatable every time I jumped into a wall in a very basic scene I had set up a week ago (just platforms and a character without any custom abilities as I was testing the newest version of the engine), so I'll submit an official bug report through the support email if I can replicate it in the demo scenes tonight.

    I ended up not going with zero air acceleration for my game and instead have instant air acceleration. Because I still wanted to have the character "push off" the wall during a wall jump and instant acceleration meant that as soon as I was in the air I would stop moving if not pressing a direction, I have a component that persists my speed for either a duration or until I hit the ground (used both in jumping off of walls and when knocked back by enemies). Because this makes my character keep going left/right even after hitting a wall, it will make my character go the last little bit and be considered colliding with the wall, and I am able to jump from wall to wall without any directional input needed on my controller. This paragraph is essentially to say that yes, the "bouncing" from wall to wall is quite doable, but does need a little custom code depending on what your character is capable of doing.
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Kelgand > If you manage to confirm the bug please use the support form to report it, thanks.
     
  20. Ioei

    Ioei

    Joined:
    Apr 23, 2019
    Posts:
    2
    Hi. I'm not capable of write code by myself yet so I want to know how far I can go with corgi engine without writing code.
     
  21. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    148
    What is the distinction of WeaponInventory and MainInventory? Is there any intersection between them? I want to save a message for which weapon be used recently,where should I save it?I am a little confused with Inventory System...
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Ioei > Hard to answer, that really depends on your skills. I guess you'd be able to do pretty much everything but add your own features, just like you would in any regular Unity project.
    @Bagazi > They're just two inventories. As for where you should save what weapon got used recently, I'd suggest creating a dedicated class to manage that. Don't hesitate to read the inventory's documentation to clear that confusion, it's all explained in details :)
     
    Ioei likes this.
  23. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    102
    I know this wasn't your exact question, but if "yet" means you're currently learning to code (or just about to start), then this isn't a bad asset to begin with. It's not going to teach you to code of course, but it's a good working model/reference for different game features and modular design.

    You can also use it as a "sandbox" to practice what you learn in tutorials, classes and from other users. There are a lot of things you can do in this engine that only require a few lines of code - that means you can focus on specific skills without worrying about "breaking" stuff (tech talk).
     
    reuno likes this.
  24. Ioei

    Ioei

    Joined:
    Apr 23, 2019
    Posts:
    2
    That's exactly the case. I'm in the very beginning of my c# course.

    Thanks for your answer. It wasn't my exactly question but the answer was perfect for a real but non asked problem. Helped a lot.
     
    Boom_Shaka likes this.
  25. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    565
    I'm working on adding a Wall Walking character ability so that players or AI can walk along walls. This new ability uses the CharacterGravity ability and uses a gravity override based on the slope of a contacted wall. The ability is mostly working but it has a few bugs that I can't seem to work out. I was hoping someone could see where I'm going wrong.

    I've added two functions to CharacterGravity.cs (I'll later move these to a subclass):
    Code (CSharp):
    1.      
    2.         /// <summary>
    3.        /// Override gravity
    4.        /// </summary>
    5.         public void OverrideGravity(float gravityAngle)
    6.         {
    7.             _gravityOverridden = true;
    8.             _overrideGravityAngle = gravityAngle;
    9.         }
    10.  
    11.         /// <summary>
    12.        /// Stop overriding gravity
    13.        /// </summary>
    14.         public void StopGravityOverride( Vector2 gravityDirectionVector)
    15.         {
    16.             _entryTimeStampZones = Time.time;
    17.  
    18.             // we reset our gravity
    19.             _gravityOverridden = false;
    20.             _inAGravityZone = false;
    21.  
    22.             StartRotating();
    23.  
    24.             // we transition our character's state
    25.             Transition(false, gravityDirectionVector);
    26.         }
    27.  
    and added a new class, ClayCharacterWallWalking:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using MoreMountains.Tools;
    4.  
    5. namespace MoreMountains.CorgiEngine
    6. {  
    7.     /// <summary>
    8.     /// Add this component to a Character and it'll be able to cling to walls when being in the air,
    9.     // facing a wall, and moving in its direction
    10.     /// Animator parameters : WallClinging (bool)
    11.     /// </summary>
    12.     [AddComponentMenu("Corgi Engine/Character/Abilities/Character WallWalking")]
    13.     public class ClayCharacterWallWalking : CharacterAbility
    14.     {
    15.  
    16.         /// This method is only used to display a helpbox text at the beginning of the ability's inspector
    17.         public override string HelpBoxText() { return "Add this component to your character and it'll be able to walk on walls."; }
    18.      
    19.         protected override void Initialization()
    20.         {
    21.             base.Initialization();
    22.         }
    23.  
    24.         /// <summary>
    25.         /// Checks the input to see if we should enter the WallWalking state
    26.         /// </summary>
    27.         protected override void HandleInput()
    28.         {
    29.             WallWalking();
    30.         }
    31.  
    32.         /// <summary>
    33.         /// Every frame, checks if the wallwalking state should be exited
    34.         /// </summary>
    35.         public override void ProcessAbility()
    36.         {
    37.             base.ProcessAbility();
    38.             ExitWallWalk();
    39.         }
    40.  
    41.         /// <summary>
    42.         /// Points gravity to a wall. Clamped at 90 degrees to prevent walking on a ceiling.
    43.         /// </summary>
    44.         protected virtual void WallWalking()
    45.         {
    46.             if (!AbilityPermitted
    47.                 || (_condition.CurrentState != CharacterStates.CharacterConditions.Normal)
    48.                 || (_controller.State.ColliderResized))
    49.             {
    50.                 return;
    51.             }
    52.  
    53.             //change gravity angle if we collide with a wall we are facing. Maxes at 90 degrees so that we don't walk on ceilings.
    54.             if ((_controller.State.IsCollidingLeft) && (_horizontalInput <= -_inputManager.Threshold.x)
    55.                 && _characterGravity.GravityAngle - _controller.State.LateralSlopeAngle >= -90)
    56.             {
    57.                 _characterGravity.OverrideGravity(_characterGravity.GravityAngle - _controller.State.LateralSlopeAngle);
    58.             }
    59.             else if ((_controller.State.IsCollidingRight) && (_horizontalInput >= _inputManager.Threshold.x)
    60.                 && _characterGravity.GravityAngle + _controller.State.LateralSlopeAngle <= 90)
    61.             {
    62.                 _characterGravity.OverrideGravity(_characterGravity.GravityAngle + _controller.State.LateralSlopeAngle);
    63.             }
    64.         }
    65.  
    66.         /// <summary>
    67.         /// If the character is currently wallWalking, checks if we should exit the state
    68.         /// </summary>
    69.         protected virtual void ExitWallWalk()
    70.         {
    71.             if (_controller.State.WasGroundedLastFrame && !_controller.State.IsGrounded )
    72.             {
    73.                 _characterGravity.StopGravityOverride(_characterGravity.GravityDirectionVector);
    74.             }
    75.         }
    76.     }
    77. }
    There are 3 issues I'm running into. Here's a video showcasing the issues.


    • If I hit a wall while on upward thrust of a jump, the character bounces off the wall rather than sticking. (0:05 - 0:20)
    • When transitioning between a level floor and a sloped wall, there's a hiccup. It didn't capture very well, but sometimes I can get the character to twitch several times in that corner before finally walking up the sloped wall. (0:23 - 0:28)
    • Occasionally if I clip the corner of a sprite, the gravity gets shifted towards the wall but the character doesn't stand on it, so they fall sideways. (0:28 - 0:32)
     
  26. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    215
    @Ioei
    When I started with Corgi Engine some time ago (v 3.1 I think) I had nearly zero coding skills -have never used C+ before- and I was able to make a short game with the included components. You really don't have to worry about that, current version have a wide load of features since them, it will cover almost anything you'll need.

    You may eventually will want to add something quite specific to your game, but as @Boom_Shaka said, this is a friendly environment asset and you can learn at the same time you use it, as I and others did.
     
    Ioei, Legionghost and reuno like this.
  27. Glytchy

    Glytchy

    Joined:
    Feb 8, 2016
    Posts:
    5
    I'm looking to build a Hover ability (use after jumping with jump button,stop falling in air, move horizontally, duration of hover, hover lasts for less time while moving - Basically the hover from X4/X5) And unsure whether I should extend Glide or Jetpack. Right now I'm thinking to either extend Jetpack or Extend Ability and base it off Jetpack. Has anyone implemented a feature like this or have any thoughts?
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Glytchy > Glide seems already pretty close to what you want, I'd start from there.
     
  29. ramtamir

    ramtamir

    Joined:
    Feb 23, 2019
    Posts:
    11
    I have a few questions before purchasing. I'm debating whether to buy corgi engine or top down engine and I wonder if the following can be implemented in either or both:

    1. Spells - both engines have weapons - is there any limitation which will prevent me from using these classes as spells? removing the aim feature and implementing pointing at a target and pressing a button for cast?
    2. Enemies and friends - I see I can define characters as friendly or enemies. Is there any limitation that will prevent me from implementing a "weapon" that will have beneficial effects on friendlies, like heals or buffs?
    3. Area of Effect - Is there any limitation that will prevent me from directing a spell to an area in the map, and have it's effect in a certain area there for so and so seconds?

    Just to be clear - I'm not asking how easy it is to implement, or how to do it, but whether it's possible or not.

    Thanks in advance
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @ramtamir > All that is possible, but not built in (to the exception of area of effects, which is already in).
    But yeah generally everything is possible, I can't think of a single feature that you absolutely couldn't do. Difficulty will vary of course :)
     
  31. ramtamir

    ramtamir

    Joined:
    Feb 23, 2019
    Posts:
    11
    And both engines are similar in that regard?
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @ramtamir > Yes, they're both built to be extended upon.
     
  33. PaulAfello

    PaulAfello

    Joined:
    Sep 19, 2015
    Posts:
    15
    I am at a bit of a loss. My levels work fine in the Unity editor but as soon as I make a build three out of the four Corgi platform levels "crash" at the start of the level. The MacOS Console tells me:
    • CameraController : The LevelManager couldn't find a Player character. Make sure there's one set in the Level Manager. The camera script won't work without that.
    So obviously that's a clear lead but I just don't get that problem in the Unity Editor. I managed to reproduce this in the editor as an error once by copying a LevelManager from the one level in the build that did work to one of the "problem levels" but when I delete that manager and just create a new one from scratch everything looks fine and dandy again... until I make a build. Same problem.

    Only other issue I could think of is that I get a don’t destroy on load warning as soon as I run the level in the editor.
    • DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.
      UnityEngine.Object:DontDestroyOnLoad(Object)
      MoreMountains.Tools.PersistentSingleton`1:Awake() (at Assets/CorgiEngine/ThirdParty/MMTools/Singletons/PersistentSingleton.cs:48)
      MoreMountains.CorgiEngine.GameManager:Awake() (at Assets/CorgiEngine/Common/Scripts/Managers/GameManager.cs:168)
    But this is not something I introduced, just came out of the box from working with Corgi and I just ignored until now. I also get this warning in the level that is working so kinda figure this is not the origin of the problem.

    I am currently on Unity 2018.3.14 and Corgi v5.4

    Please help!
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @PaulAfello > As that error you mention tells you, you can't put DontDestroyOnLoad objects that aren't at the root of your hierarchy. In this case the GameManager. Just put it at the root. Can't tell if it'll solve your other issue though, but that'll get rid of that error at least. If the problem persists please use the support form, thanks!
    I doubt that warning was there from the start though, it'd have been reported by now. If you can reproduce it on a fresh install (fresh install, fresh import, no changes made) then please let me know where I can reproduce it via the support form and I'll fix it right away, that'd definitely be a bug :)
    Edit : same thing for your first bug, if that happens when building the demos, no changes made, I'd need to know how you proceed, because I've never seen such errors and they definitely should not happen with a fresh install.
     
    PaulAfello likes this.
  35. PaulAfello

    PaulAfello

    Joined:
    Sep 19, 2015
    Posts:
    15
    Ah, so it was something I introduced by moving the GameManager into a "Managers" object, check! Let's hope it solves that other error as well :) Thanks for the quick reply!
     
  36. PaulAfello

    PaulAfello

    Joined:
    Sep 19, 2015
    Posts:
    15
    @reuno And sure enough it solved the problem!
     
    reuno likes this.
  37. Hedgehog71

    Hedgehog71

    Joined:
    Nov 26, 2017
    Posts:
    1
    Very impressive, recently bought/downloaded and overwhelmed with the number of features. Just now learning to use the engine with the video tutorials. Is there any way to download the full manual in PDF or different format so i can read it offline/print it out?
     
    Last edited: Apr 30, 2019
  38. KriYorDev

    KriYorDev

    Joined:
    Oct 3, 2017
    Posts:
    27
    Has anyone tried adding sound to a moving platform?
    What I want is to add an sound each time the platform reaches one of the path points.
    If I could add a different sound depending on the path point it would be even better, but for now, I am thinking of how to approach this.
     
  39. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    215
    I see two options:

    1- You can mod MMPathMovement to add extra features. Pros: it's added as another option below Delay in each point. Cons: Will have to redo it on next update.

    2- You can extend MovingPlatform to add whatever you want. Pros: no prob with updates. Cons: You'll need a new array not linked to the path one.

    Hope it helps.

    Edit: forgot to add something on the second option.
     
    Last edited: May 7, 2019
  40. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    565
    I'd like to create water where the character floats at the surface rather than sinking down. Any recommendations for how to set this up with existing Corgi components or do I need to write my own? I've experimented a bit with using a CorgiControllerPhysicsVolume to push the player up to the surface, but it launches the player out of the water, at which point regular gravity applies, the player drops below the surface, rises again, and starts it all over. I'd like the player to drop down below the water surface when they jump in, rise to the top, and stay there, partially submerged. Jump to leave the water, just like the normal swim.

    Basically I'm looking for jumping into water to have a trajectory like this:
     
    Last edited: May 1, 2019
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @Hedgehog71 > No, unfortunately there isn't.
    @kriyordev > Exactly what @Muppo said :)
    @mattimus > I think this would require a specific ability. I'd probably kill gravity and just move the controller along an animation curve on the y axis for this, until it's stabilized at the surface. So maybe looking at how the CharacterFly ability works would be a good start.
     
  42. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    565
    Problem resolved. I wrote a subclass of swim that pushes the character upward until the midpoint of the character's bounds is above the water surface and then zeros out vertical force. I now have characters that float and characters that sink.
     
    Mindjar, MudPuppet, Glytchy and 4 others like this.
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @mattimus > Very nice result! (Also I really like that big chunk of blocks in the background)
     
  44. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    18
    i'm struggling with the inventory script and custom object : when i use the chicken object, i can change level and keep it in my inventory, but when i'm using my own object , i can add it in the inventory but when i load another scene i have an error message and the inventory is empty.
    - i made a new base item like chiken
    - i used a new Item name (same as Item ID)
    - i bind the new prefab object with the new base item
    I don"t understand where is the problem

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. MoreMountains.InventoryEngine.Inventory.ExtractSerializedInventory (MoreMountains.InventoryEngine.SerializedInventory serializedInventory) (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:447)
    3. MoreMountains.InventoryEngine.Inventory.LoadSavedInventory () (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:400)
    4. MoreMountains.InventoryEngine.Inventory.OnMMEvent (MoreMountains.Tools.MMGameEvent gameEvent) (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:699)
    5. MoreMountains.Tools.MMEventManager.TriggerEvent[MMEvent] (MMEvent newEvent) (at Assets/CorgiEngine/ThirdParty/MMTools/Events/MMEventManager.cs:176)
    6. MoreMountains.Tools.MMGameEvent.Trigger (System.String newName) (at Assets/CorgiEngine/ThirdParty/MMTools/Events/MMEventManager.cs:28)
    7. MoreMountains.CorgiEngine.LevelManager.Start () (at Assets/CorgiEngine/Common/Scripts/Managers/LevelManager.cs:188)
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @krisss666 > I'm guessing you either didn't create your object properly, or didn't reset your inventory after creating the new object. Either way, I'd recommend reading the Inventory Engine's documentation, it explains it all in great details, and if you follow these steps it'll work every time. If the issue persists though, please use the support contact form.
     
  46. Glytchy

    Glytchy

    Joined:
    Feb 8, 2016
    Posts:
    5
    @mattimus how did you get the vertical force to zero out correctly? i tried this in earlier attempts at my hover ability and it wasn't working the way i had expected
     
  47. Pacaworks

    Pacaworks

    Joined:
    Jan 28, 2016
    Posts:
    12
    Hello @reuno !

    What should I call if I want to respawn all enemies? (I'm implementing a sleep & save mechanic)
    I tried calling CorgiEngineEvent.Trigger(CorgiEngineEventTypes.Respawn), .GameOver & .PlayerDeath without success! :/

    Thanks for your attention!
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @AesopWorks > There is no such event, you'd need to go through all characters and call their revive method.
     
    Pacaworks likes this.
  49. Pacaworks

    Pacaworks

    Joined:
    Jan 28, 2016
    Posts:
    12
    I use the Auto Respawn component, but can't figure out where can I place a "if (sleep) --> Revive();".
    Or as you're saying, I should create a static variable that all enemies can access? I'm confused on how the Auto Respawn.cs knows when to revive.

    Sorry for bother you & thanks for the quick answer!
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,110
    @AesopWorks > As explained in the documentation (or in the class itself), the AutoRespawn works (mostly) with Checkpoints. Here, from what I understand, you just want to revive everyone, so it's a different thing, and as I said you just need to call each Character's Revive method (that's on the Health component, you don't need AutoRespawn for that).
     
    Pacaworks likes this.