Search Unity

[RELEASED] Rex Engine: A Unity 2D Platformer Engine

Discussion in 'Assets and Asset Store' started by BeeZee, Jun 20, 2017.

  1. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Hey, I was wondering, is there any way to set specific idle animations to play only in specific scenes? Such as a "shiver" animation that plays during a snow level for example.

    Also, is there a way to make background layers only scroll on a certain axis, like have it scroll only horizontally but not vertically? And if so, set it for specific scenes?

    Quick edit: I asked about the crouch mechanic awhile back, but since I've put my new sprites in, I've got another question about it. I set the collider to be the same as my box collider and then adjusted the pivot so the sprite lines up correctly, but I'm assuming that would make the collider bigger than it should be, right? Is there a way to see the crouch collider or do I just have to edit it though trial and error? (I tried halving the vertical size of it and now the sprite "jitters" for a sec and repositions itself slightly higher than it should.) And did I even set it up the right way?
     
    Last edited: Jan 20, 2020
  2. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    Similar to my previous answers regarding death conditions, I think you'd need some way to tell the character what type of level he's on. I'm handling these types of things with a "Custom Level Settings" script that just has some variables that I can change depending on the level. Like a bool to tell whether it's a cold level or not. From there you'd probably have to modify the IdleCoroutine of RexController.cs to check what type of level its in, and play the shiver animation if it's a cold level, or a standard idle animation if it's not, or even randomly play either one. That's how I'd be doing it, but @BeeZee might have a more robust solution.

    Unfortunately I don't use Rex's camera system but the ScrollSecondaryCameras method of RexCamera is probably a good place to start looking.

    Is the Collider Offset Y value of the Crouch State component a negative value? I was having the same flickering issue because I was pasting 0.34 instead of -0.34. I'm not sure if there's a better way to find out what the correct values are without just trying to line up the collider values with the sprite.
     
    Last edited: Jan 20, 2020
    PhantomFox128 likes this.
  3. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    So, I tried this and now my character is sinking into the ground a bit. Is it all dependent on Collider Offset Y? From what I've tried, changing the value to virtually anything would make him rise or sink a bit (although if it was too much, he'd flicker a ton). I just tried going back to the original value I had and now it seems to be working, but I'm worried it might just be fluke for now. Also, I'm still thinking the collider size is too big, but changing that value doesn't seem to help either. I tried halving the Collider Size Y value (since the character is roughly half his size crouching) and that just made it worse. It's just weird, because when I had my placeholder sprites, I managed to get it all working fine, but now it just doesn't seem to want to cooperate.
     
  4. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    The goal there is to keep the bottom of your collider in the same place, whether you're standing or crouching. If the bottom of the collider moves, it's going to inherently push you into terrain (or into the air) which will manifest as a jitter. You'll most likely just need to math it out. The factors are going to be the collider size Y and the collider offset Y. Sprites themselves aren't going to matter. If you select the GameObject for your player in Scene view while you're playing, you can watch the green collider outline in realtime, which should give you an idea of what's happening.
     
    PhantomFox128 and Bagnol like this.
  5. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    So I had a question about using this engine. I am wanting to build my own game on using the engine as a base I am struggling to figure out what elements of the demo can be removed with out the engine breaking. I would like to trim out as many of the elements that I am not using as possible. Additionally, is it possible to add your own items to the rex pallet window?
     
  6. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    Yeah as BeeZee mentioned, it's not specifically the negative value that will make it work, it's just what was causing it for me. It will depend entirely on your specific player size and will probably require a bit of entering and exiting play mode to test different values. I think I copied and pasted values into notepad and back into Unity about 5 times before getting it right. You'll notice as you're making changes to the collider with the little "Edit Collider" button, the offset and size will both automatically change together. Unfortunately I think it's just a bit of trial and error.

    @BeeZee As a way to maybe make the crouch collider process a little more smooth, what are your thoughts on switching the order of the Collider Size and Collider Offset variables in the Crouch State script/inspector in a future version? It looks like they're currently backwards so the order appears as Offset, Size, Size Offset when looking at the inspector of the collider and Crouch State component together. Which might cause people to put the values in the wrong sections.... like I may have once or twice.
     
    PhantomFox128 likes this.
  7. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    If you mean parts you're able to remove/exclude from scenes, there's really not a whole lot required. If you go to Tools>Rex Engine>Setup Level Scene you'll notice it'll add 4 GameObjects - RexEngine and its child GameObjects which you'll want to keep , then BG, Terrain and Actors which can all be deleted and replaced with your own assets.

    If you mean what elements of Rex you can strip out completely, I wouldn't delete anything from the Rex Project folders, but the system itself is very modular. You can remove most abilities from the character, like crouching, jumping, wall clinging, shooting etc. by just removing/disabling the associated State component on the Controller section of the player prefab. A lot of the actual game management functionality comes from the objects within the Singletons prefab. I wouldn't touch those too much if you can avoid it, but they're unpacked/instantiated into the scene hierarchy when the game starts. Are there specific features you're hoping to strip out?

    As for the palette, it's a feature I don't really use all that often, but I think you'd have to add code to the RexPalette.cs script. Keep in mind though that any modifications/additions are at risk of being wiped if you update Rex - especially if BeeZee adds any new items to it. I'm not sure if keeping the script update-safe by making an extension is an option with these Editor windows though.
     
  8. hippobob

    hippobob

    Joined:
    Feb 26, 2017
    Posts:
    33
    Hello, I find the UI system not very friendly. It doesn't have the same automatic stretching and visual positioning as UGUI.
    In particular, automatic stretching doesn't seem to work. This forced me to do it twice for the Iphone and twice for the ipad.
     
  9. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    I am mostly wanting to remove the demo scenes as well as the artwork that the demo uses. Yet even just removing the demo scenes prevents the game from loading. I am using mostly just the physics and the built in states and was just wanting to trim out the unneeded data from my project.
     
  10. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    I believe Unity will exclude all of the extra art assets that aren't used when you build the game, so personally I'd just generally leave them as they are. If you specifically want to delete them though, maybe to keep the project folder on your computer as small as possible, it will depend on what you're using exactly. Deleting the included particles will cause reference errors in the HitSpark section of the Singletons prefab, for example. If however you replace the art/particles/audio of every demo asset you use, I think you *should* be able to delete the Sprites, Audio, Animation, Integrations and Scenes folders, and even some of the Resources folders.

    You'll also have to make sure you've added your new scenes to the build settings, and selected your scenes for the slots under the Lives category in the Window>Rex Engine>Rex Settings window.
     
  11. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Okay, I messed around with it for a bit and got it positioned correctly, so it's (almost) working. The only issue I'm having now is that upon releasing the crouch key, the collider goes into the terrain for a moment before forcing itself back on top where it needs to be. From what I can tell, the colliders height is being decreased by half (that's what I have the crouch collider set to). From releasing the key, the collider goes back to it's normal size, but seems to do so from the bottom. So because it does that, the collider ends up going just past my terrain collider for a brief moment, before orienting itself on top of the terrain collider like it should, which is causing the character to sort of "bounce" whenever they get up from a crouch. Also, it sort of seems to do some little upward "bounce" upon pressing the key as well, instead of immediately transitioning to the crouch sprite. So I guess that's what the problem is. Not so much the crouch itself, but the transition to and from the crouch. I'm essentially trying to do the same thing plenty of other games have done where you're standing one frame and crouching the next, but this bounce is preventing that and I don't know how to fix it.
    I tried looking at the Rex demo to get an idea of what to look for and the collider there also seems to bounce a little when crouching, but nowhere near to the extent that mine is doing.

    I'm not sure if what I just said made sense, but that's the best I can explain it. Adjusting the Offset value also seems to simply set the character above or below where they should be. It doesn't seem to be having any affect on how the collider itself behaves as far as I can tell.

    Actually, quick side note: could it possibly have to do with the raycasts? I noticed that the raycasts are all perfectly aligned within Booster's crouch collider, but mine are a bit off to the side.
     
  12. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Rex doesn't really have a UI system. It does have a component that I added to anchor UI elements to the sides of a screen (Rex UI Anchor), but feel free to remove that and use any other UI system you'd like.
     
  13. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    If you start a fresh scene, drag your Player prefab onto the stage, select its root GameObject, and go to Tools > Rex Engine > Setup Minimal Actor, that should give your player prefab everything it needs to operate alone, without *any* other Rex stuff in the scene.

    You should safely be able to remove the demo scenes and art. I'd make sure the game isn't trying to load into any of the demo scenes when it starts, and that the Default Spawn Scene under the Lives section of your Rex Settings window (Window > Rex Engine > Rex Settings) isn't set to any of the demo scenes.
     
  14. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Is your crouch collider the same width as your regular collider, and do they have an X offset in the BoxCollider2D settings? That's the only thing I can think of that would cause a raycast offset, but otherwise, the raycasts should adjust themselves to the size of your collider.

    I'd also make sure that the BoxCollider2D on your RexController object is the same size as the BoxCollider2D on your root RexActor object.

    It's also possible this is related to the sprites themselves. I'd keep an eye on where those are falling relative to your collider in Scene view when you crouch.
     
  15. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    There is an X offset, yeah. Could that possibly be the cause of it?
     
  16. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Is Rex compatible with things like the Universal Render Pipeline?

    Also, I just realized I was using an older version of Unity. Would that have been causing issues?
     
    Last edited: Jan 23, 2020
  17. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    After working around a little bit I actually do have one more question. Are there any tutorials or resources for anchoring in and setting up our own animations for the player character? I have the animations I want to use and I slotted them in the correct spots on the various components but it does not register properly and instead doesn't animate anything at all. Any advice would be greatly appreciated.
     
  18. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Quite possibly, but it's hard to be sure without testing. I'd get rid of the X offset if you can.
     
  19. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    I'm not super familiar with the Universal Render Pipeline, but Rex just uses Unity's existing display stuff, so if it works with vanilla Unity, it should work with Rex.

    Rex should work with every version of Unity from 5.6 onward.
     
    PhantomFox128 likes this.
  20. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Sure thing. Here you go:



    I've found there are a couple of gotcha moments, mostly with how Unity handles its Animator and how adding frames to an AnimationClip can inadvertently add an extra SpriteRenderer to your object. Those are covered in this video, so this should get you where you need to go.
     
  21. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Sweet, thanks. I'll try it out.

    Another quick question: Is it possible to slot in a particle effect for the visual effect of a melee attack, specifically the slash effect? Or does that have to be animated separately?

    Edit: While I'm on the subject, I've got a bit of a problem regarding attacks. I've had a three hit combo chain set up for awhile, but for some reason, there's this massive delay between attacks two and three that sometimes doesn't even register. The first two attacks play and work just fine, I got the cooldown frames and everything set up, but when I mash the attack button, the third attack doesn't register normally, either taking twice as long than it should for the attack to come out or not at all. I've rewatched the attack combo video and messed with some settings, but nothing seems to be working.
     
    Last edited: Jan 25, 2020
  22. tiz777

    tiz777

    Joined:
    Jan 20, 2010
    Posts:
    93
    Hi BeeZee,

    I got Rex Engine a couple of weeks ago, and I'm very happy with it so far! I really appreciate your hard work you put into it, it's really impressive and well done!

    I have some questions/notes for you:
    1) I'm looking to bring some analog walking to the player, not sure to have done it right, I modified the RexInput.cs in this way:

    Code (CSharp):
    1. float axisVal = InputManager.Instance.GetAxis(playerId, InputAction.MoveHorizontal);
    2.                 if (axisVal > 0.2f || axisVal < -0.2f)
    3.                 {
    4.                     horizontalAxis = axisVal;
    5.                 }
    6.                 else
    7.                 {
    8.                     horizontalAxis = 0.0f;
    9.                 }

    instead of:

    Code (CSharp):
    1.   if(InputManager.Instance.GetAxis(playerId, InputAction.MoveHorizontal) > 0.5f)
    2.                 {
    3.                     horizontalAxis = 1.0f;
    4.                 }
    5.                 else if(InputManager.Instance.GetAxis(playerId, InputAction.MoveHorizontal) < -0.5f)
    6.                 {
    7.                     horizontalAxis = -1.0f;
    8.                 }
    9.                 else
    10.                 {
    11.                     horizontalAxis = 0.0f;
    12.                 }
    it works as expected using the analogic stick, but it seems to break something when slipping on the ice blocks, and can't figure out what could it be. It happens that it doesn't slip when changing direction (it changes immediately without applying the ice deceleration), but if I use the d-pad it always works.
    Any tips on this?

    2) In the RexActor, there is LerpSpeed for lerping sprite rotation, but it isn't implemented, any chance this will be done in a future release?

    3) Guess this is a Bug:
    Ice + Conveyor Belt, if placed next each other and the player walks from the ice to the belt then can't no more move on the opposite direction. This happens on a clean project too.

    4) Just a little thing, Line 70 of Stairs.cs:
    Code (CSharp):
    1.  #if UNITY_EDITOR_2018_3_OR_NEWER
    should be replaced by
    Code (CSharp):
    1.  #if UNITY_EDITOR && UNITY_2018_3_OR_NEWER
    Many thanks in advance for your help and time :)

    Cheers,
    Tiz
     
    Lars-Steenhoff likes this.
  23. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Glad you're liking Rex so far!

    1. I think that should give you some analog movement, plus a 0.2 dead zone, right? I'd say if you like how that feels, it should be fine. You can check out Ice.cs file to see the Ice movement. The "MovePhysics" function gets called every time an actor is on the ice, and lines in there like line 22 will deal with input direction. (Bear in mind that Ice was built on the assumption that input is binary and not analog, so I can't 100% say for certain if it will work with analog controls, but that's where I'd start looking!)

    2. I left a lot of the rotation code in RexActor.cs on line 821, in the RotateForSlope() function. I don't think it was every fully completed -- if I recall, it largely worked but also was unpolished and could get weird sometimes. I don't have any concrete plans to revisit it, but I think the code is mostly there if you're interested.

    3. I'll have to spend some time looking into this one. Thanks for bringing it to my attention!

    4. Thanks for letting me know! I'll get it fixed up for the next update.
     
    tiz777 likes this.
  24. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    You'll have to add in your own particle effects to the start of an attack.

    I'd check the demo character's MeleeComboChain to see how his 3-hit combo is set up (I think that one has a 0.25 second delay between attacks, and that should entirely be set up via the Cooldown Frames.) I'd also check to make sure your AnimationClips for your second attack aren't going on longer than you mean for them to, since that's what will tell Rex that the attack is complete.
     
    PhantomFox128 likes this.
  25. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    This is probably a simple question but I am struggling to figure out how to add force to an object in the physics engine. The documentation shows several functions that should be able to be called to add velocity to an object but all of them fail to compile. It is easy to manually set movement but the manual methods I am aware of don't interface well with the engine's physics.
     
  26. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    You'll want to call everything on the RexPhysics component. Here are the main ones I'd use:

    Code (CSharp):
    1. SetVelocityX(float _velocity), SetVelocityY(float _velocity)
    The two above will directly set the X or Y velocity.

    Code (CSharp):
    1. public void ApplySingleFrameVelocityAddition(Vector2 _velocity)
    The above will move an object a distance just over a single frame.

    Code (CSharp):
    1. public Force ApplyForce(Vector2 _speed, int _totalFrames, bool _clearOnGroundCollision = false, bool _clearOnCeilingCollision = false, bool _clearOnWallCollision = false)
    The above will add an external force to the object, which can be set to last for a specific number of frames (or until a terrain collision on a specific side), at which point the force will clear itself.
     
  27. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Figured it out. My last attack didn't have the "Attacking" box checked under "Actions Allowed During Attack." Checking that seems to have fixed it.

    Real quick, is there any way to set an attacks collider to only work on certain frames? My attack animations are set up in a sort of Smash Bros.-like way (there's a bit of wind up and a bunch of follow through frames in between the actual "attack" frame) where the player can perform the next attack anytime during the follow through, but as of right now, the collider is active throughout the entire move.

    Edit: Running into another problem. I have it set up so that the player has to essentially commit to an attack upon pressing the button. The only action they are allowed to perform afterwords is another attack in the chain or just wait for the current attack to end. However, I'm guessing that since the box I mentioned is checked, the player can immediately cancel their current attack and perform a different attack (I've mentioned before that I've got two attack buttons). How do I fix that?
    And to go off of this, even though I have it set that the player can't do much while attacking, they can still get in and out of a crouch while the attack is going for some reason. While testing, I'm able to perform an attack and then crouch immediately. The attack collider is still active for the remainder of the attack, and if leave the crouch, the animation still plays (it doesn't get canceled, it just keeps playing). What I need though is to NOT have the player be able to do that.

    Double edit, sorry for all these: I made a second combo chain (just two heavy attacks) and for some reason, it's not resetting. After performing it, only the last attack plays after pressing the button. First attack won't play back at all. I checked the properties of my previous chain and can't find anything out of the ordinary. Nevermind, I think I figured it out. Seems there was too few animation frames and too much cooldown. Although now I'm wondering would I need a ton of animation frames for a slow, heavy hitting attack?

    Triple edit: Real fast, is there a way to set certain attacks to have more knockback than others? Like when doing a 3-hit combo, the first two hits don't have much (if any) knockback while the third hit knocks enemies back quite a way?
     
    Last edited: Feb 5, 2020
  28. thenadamgoes

    thenadamgoes

    Joined:
    Apr 26, 2019
    Posts:
    29
    Hi All, I just downloaded Rex Engine and I'm enjoying it. But I'm still really new to Unity in general. I have a question, but like I said. I'm still new to Unity so I apologize in advance if the solution is stupid simple.

    I have two scenes that I want to go in between and I'm using the Sceneloader gizmo to do it. I have them set up correctly on the left and right of each scene.

    Each scene works on it's own with the Spawn point.

    However, when I try to go between scenes it will unload the current scene, but fails to load the other scene. It just pauses.

    The only solution I've found is to drag the other scene into the hierarchy of the current scene, and then unload it. The sceneloader works after I do that. But since it's unloaded it doesn't stay in the heirarchy and the sceneloaders don't work again.

    I've looked through the demos a lot but I can't for the life of me figure out what I'm doing wrong.
     
  29. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    I'm not 100% sure, but it sounds like your scenes aren't part of your build. If you go to File -> Build Settings and then add your scenes there, they should start working.
     
  30. thenadamgoes

    thenadamgoes

    Joined:
    Apr 26, 2019
    Posts:
    29
    That fixed it! I knew it was something stupid simple. Thank you!!
     
  31. zenrix

    zenrix

    Joined:
    Dec 5, 2015
    Posts:
    1
    Does anybody here know how to get the new 2019.3 render pipeline to work with Rex Engine. I just casually changed the renderer and now nothing renders. Would like to use the new 2d lighting and shader graph features.
     
  32. jemchicomac

    jemchicomac

    Joined:
    Jan 2, 2018
    Posts:
    10
    Hi,

    when player is dashing up (and not right-up or left-up) the sprite is flipped when dashing animation starts. I've been reviewing the controller and everything seems to be ok.

    This is what happening:

    bug on dash.gif

    Any clues on what's wrong?

    Thanks
     
    Lars-Steenhoff likes this.
  33. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Heya, I looked into this and discovered that it's a bug. I was able to fix it, fortunately! I'll include the fix with the next official version of Rex. In the meantime, if you want to shoot me a PM, I can send you the fixed files.
     
    Lars-Steenhoff likes this.
  34. LuxStudio

    LuxStudio

    Joined:
    Jul 4, 2018
    Posts:
    2
    CHEMAX3X likes this.
  35. jemchicomac

    jemchicomac

    Joined:
    Jan 2, 2018
    Posts:
    10
    Thanks man!

    I will send you an email about this topic. For me is still unclear how to upgrade Rex without breaking things in my project, hence I will try to fix the bug in my current project
     
  36. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    Back with another quick questions. Based on the documentation it would seem that I should be able to use and access the bool willStickToMovingPlatforms to allow for the object to ride along top of them. Yet, whenever I try to call and change that variable it says that RexPhysics has no such variable. Am I doing something wrong here?

    Edit: In fact it would seem that I am unable to access any of the Public Members listed on the documentations website.
     
  37. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Thanks for bringing that to my attention!

    The moving platform stuff got deprecated a while ago. Moving platforms still work, but there's no need to mess with any of those Inspector settings anymore. Anything with the PhysicsMover tag with a MovingPlatform component on it should now act as a moving platform automatically.

    All the non-moving-platform related stuff in the RexPhysics documentation is definitely still there.
     
    Last edited: Feb 10, 2020
  38. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    Okay, I’ve been trying to work through the engine and a updated documentation would be greatly appreciated.
     
  39. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    Was working with the engine and believe I have encountered a bug. If you are pushing a pushable block and it collides with a wall with a tilemap collider on it the box jumps up to the top of the wall. If you want I can try and provide you a video of the error happening. Perhaps something else is wrong in my scene.
     
  40. tiz777

    tiz777

    Joined:
    Jan 20, 2010
    Posts:
    93
    Hi Tom, I was interested in this too, and I found that if the terrain (the collider of the terrain) is aligned with the tilemap no glitches appear, but if the terrain is not aligned with the tilemap the box will be lifted to be aligned with the tilemap. Hope this can help :)
     
  41. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    I am still having issues even after double checking the alignment. The object jumps upwards what amounts to several unity units and if the player continues to walk forward the box slides across the top of the wall as if it was being pushed even though they are no longer in contact. It is quite odd.
     
  42. zengsadi233

    zengsadi233

    Joined:
    Aug 15, 2017
    Posts:
    13
    Hi, I update my project to unity 2019.3 to use enable Enter Play Mode Options( it made the play mode run fast ) and find that InputManager didn't work when I enter playmode again. And I add this code is InputManager.cs and it works! Hope this would help!

    Code (CSharp):
    1. [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
    2.         static void Init()
    3.         {
    4.             instance = null;  
    5.         }
    Resources Link: https://blogs.unity3d.com/2019/11/05/enter-play-mode-faster-in-unity-2019-3/
     
    andreiagmu, BeeZee and Lars-Steenhoff like this.
  43. zengsadi233

    zengsadi233

    Joined:
    Aug 15, 2017
    Posts:
    13
    Hi, I find another small bug.
    In WorldActionSequence.cs, the worldActions didn't init. It is null but in DrawInspectorGUI still loop the worldActions and the editor report error.
    QQ截图20200212143253.png
     
  44. thenadamgoes

    thenadamgoes

    Joined:
    Apr 26, 2019
    Posts:
    29
    I have a question about the new ability button. I searched the thread but couldn't find anything, so forgive me if this has been answered or is common knowledge.

    But is there an easy way to add other mechanics to the new ability button? Like Dash or Melee?

    I've also been trying to figure out how to make the new ability feature work without it being a button, but just an icon that is touched. Is there a way to do this as well? Thanks!
     
  45. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Upon attacking an enemy, I get this:

    Animator.GotoState: State could not be found
    UnityEngine.Animator: Play(String, Int32, Single)
    RexEngine.RexState: PlayAnimation() (at Assets/RexEngine/Scripts/RexEngine/_States/RexState.cs:132)

    and it doesn't go back to the previous animation. It gets stuck in its hit animation.

    I'm having this problem as well. Does anyone know what's going on?


    EDIT: I just got ProCamera2D and I'm not quite understanding what to do to set it up with Rex. When I double click on the RexProCamera2D folder, it opens in my file explorer, but then I'm not sure what to click afterwards (I'm using Windows while the video uses Mac and the way to go about it seems different).
     
    Last edited: Feb 13, 2020
  46. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    I haven't seen this before, but I'll look into it. Thanks for letting me know!
     
  47. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Thanks. Were you able to get around this? It's possible that deleting that particular world action and making a new one in its place will fix it.
     
    zengsadi233 likes this.
  48. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    The new World Actions system will do what you're looking for. I'll have a video on these soon, but in the meantime, opening up the Rex Palette and going to Gimmicks > Switch Button will give you a button with a few options of interest. On the Switch Button component, you can set how the switch is activated (i.e. jumping on it, touching it, attacking it, etc.). On the World Action Sequence Set component, you can set it to enable or disable abilities from your player. Note that the ability already has to be on your player, just disabled, and then this will enable it.
     
  49. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Sounds like your enemy can't find its Default animation clip. Is that slotted on its Rex Controller? And if so, I'd double-check that the name of the animation clip matches the name of the animation state in the Animator.

    Here's a tutorial on Pro Camera 2D:

     
    PhantomFox128 likes this.
  50. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Hey, thanks for that! Animation is working now and I got the camera set up. Quick issue with the camera though (even though it's not necessarily related to Rex), I opened it up and just clicked on a couple of stuff just to see what it would do and now the camera is zoomed in a ton, and I have no clue what I actually did or how to bring it back. EDIT: Nevermind. Figured it out.

    On a more Rex related note though, items (specifically the bolt) won't show up in the Game view. They can still be collected, but the sprites aren't rendering for some reason.

    Quick edit question: Is it possible to add another background layer, specifically between the background and canvas layers?
     
    Last edited: Feb 14, 2020