Search Unity

[Released] 2D Jump'n'Run Framework

Discussion in 'Assets and Asset Store' started by Samb88, May 23, 2011.

  1. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    Hey modeling_man,
    no, you can get the mega pack every time, just send me an e-mail :)
     
  2. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    How to have this great Megapack ??? PM sent...

    6R
     
  3. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Hi Samb :) Not sure why but in my level when i have ladder and plastforms ( rigt site of the screen ) when my player is going down and is contacting with the ground i can walk left right ( animation then is changing from climbing ) but when i copy theseme ladder and platforms to the left site of my screnn i cant go left or right ( animation is still climbing ) but why if this are theseme meshes ? I was playing with this a couple of hours and not sure why is that...
     
  4. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Nice update Samb ! :) Problem with long ladder gone thank You :)
     
  5. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    There is the problem... set falldamage to 50 ( your max health 50 ) and try to fall from big distance ( player is falling trough platforms )
     
  6. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    I check and in your example file when enemy hit you a couple of times and you die player is fallling trough platforms (coliders) too.
     
  7. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    186
    I have a few suggestion for this framework: Ignore Jump on Enemies. I like the Mario jump on an Enemies head to kill them, but what if I don't want this for my game? In my game, I want the user to punch/kick his or her way through the enemy.
     
  8. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    @elizeusz
    You're right, that should be because I have now "freeze player" and "player can move". "player can move" now only disable the users input, but won't freeze the player in place. Will be fixed in the next version, sorry for that!

    @gregmax17
    Or in other words: We need a second enemy AI component :) I will work on something like that for the next update.

    So lets say: Next up: Crouching and a second enemy AI!
     
  9. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Perfect :) When is time for next update ?
     
  10. Routalanttu

    Routalanttu

    Joined:
    Jun 15, 2012
    Posts:
    2
    Hey,

    Thanks for this excellent framework; it saves a ton of my precious time. However, right now that time is consumed by trying to figure out how to make the walljumping more Mega Man X-esque, meaning that in order to make a wall jump, the player should put the analog stick or press the directional key into the OPPOSITE direction of the wall while pressing Jump. How should I approach this problem?

    I've attached an image which describes what I'm trying to accomplish:
    1. First, jump towards the wall.
    2. Stick to the wall and slide along it by holding your direction towards the wall.
    3. Quickly switch your direction into the opposite, towards your jumping direction (in other words, off the wall) and press Jump.
     

    Attached Files:

  11. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    186
    @Routalanttu - I agree with you there, it makes more sense and didn't think about it at first. I vote for this as well.

    I have a question in regards of this framework, is it possible to make my player jump through the ground, yet stand on top of the platform. I think its called a "cloud" effect/platform. Is there way to do this at the moment? I can probably write a quite script to do this otherwise (just thought to ask before I dig into this)
     
  12. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    One way collision?
    Use a plane as collider of the platform.
     
  13. KeepTrying

    KeepTrying

    Joined:
    Feb 23, 2011
    Posts:
    119
  14. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Can i use NGUI with your joystick script ?
     
  15. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    @Routalanttu
    Hm, I think your problem is if the player is wallsliding and press in the opposite direction, there is no way the player can make a walljump anymore. like "press left and one frame later jump, player will just fall down".
    So what we need is something like a cooldown, that we can say "the player got 0.1 second to walljump after he lifted the directional key".. I have to think a bit about it... But it should be possible. Hope that's the problem?

    @gregmax17
    Hmm no, right now there is no script for that. But some ways to achieve this, like a "if(player-position-playercolliders-halfsize>platform-position) then make it a solid gorund". I think we need some more example scenes :)

    @elizeusz
    As far as I know.. no.. I have to see how NGUI works..
     
  16. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    186
    I just thought of a few more suggestions for this framework (I keep coming up requests, sorry):

    1 - swimming
    2 - rope swinging

    When is the next expected release and what will the new features be? (no hurry, just curious - you are doing great on this btw)
     
  17. BCEmcke

    BCEmcke

    Joined:
    Jun 6, 2012
    Posts:
    4
    I would like to see swimming as well. Maybe with an oxygen bar.

    Is it possible to spawn an enemy at the exact location where the player died?
    Cheers
     
  18. harry hayes

    harry hayes

    Joined:
    Jul 11, 2010
    Posts:
    2
    Yes, I agree - the rope swinging and swimming would be excellent - Sam did mention swimming before, so he's probably got that down for a future release.

    While I'm here, can anyone tell me how to get the health to register in the UI - I couldn't see anything in the documentation. Sorry if this is an obvious question - I'm new to this.

    Thanks
     
  19. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    Hotfix is submitted, thanks to BCEmcke, because of his request I found a bug in playerHealth :)

    @BCEmcke
    I added "Spawn Enemy" to PlayerHealth. Set it to a prefab (for example an enemy) and it will be spawned where the player died.

    @Routalanttu
    Time for Walljump will now delay the detaching of wall while wallsliding. That should make it a bit easier to walljump and a bit more megaman-ish :)

    @harry
    I have to look into PlayerUI. something is wrong there..
     
  20. BCEmcke

    BCEmcke

    Joined:
    Jun 6, 2012
    Posts:
    4
    @Samb88
    Thanks, that's awesome. This'll save me a lot of time. :) (Next on the agenda: The famous 'Make mindblowing game' button)
     
  21. harry hayes

    harry hayes

    Joined:
    Jul 11, 2010
    Posts:
    2
    @Samb88
    No problem - there's plenty else to get on with - I'm sure you'll sort it in a later update.
    Great package!

    Thanks
     
  22. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Thank You Samb for update now everything working like before:) But i have problem with sticking my player to walls ( wall jumping is disabled) and to other coliders do You know why ?
     
  23. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    I found the problem :) now everything is perfect.
     
  24. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    Hey all,
    I'm very grateful for the support everyone of you gave me! So I decided to use a free day do make a new example scene for the framework:

    This example scene is made for the framework, si I haven't touched a single line of the player code, just made some additional coding (the soccer ball and the goals). But, as you can see, you can create some fun minigames without much extra work :)

    And, of course, this example scene will be included in the next version, without extra charge!
    So yes, have a great weekend! I will submit the new version on monday :)

    -Samb
     
  25. KeepTrying

    KeepTrying

    Joined:
    Feb 23, 2011
    Posts:
    119
    This framework is truly keeping better and better;
    Nice one Samb, again :)
     
  26. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Wow looks interesting thank You Samb ! :)
     
  27. Routalanttu

    Routalanttu

    Joined:
    Jun 15, 2012
    Posts:
    2
    Yes, that's pretty much exactly it, but maybe this would be another way of approaching it:
    Regardless of whether or not you've pressed the direction off the wall, ANY GIVEN MOMENT when the player is at a reasonable proximity of the wall, pressing the jump button would make him jump off of it. In other words, the walljumping ability would never be unavailable when the player (almost) touches the wall. It works brilliantly in Mega Man X. This way, you could press a key or hold the stick in any direction you want or not even press/hold it (whatever your preferred way of walljumping is), and you could still walljump. Drop down hundreds of meters next to the wall with your back against it, and you can still bounce off of it once you press the jump button. Basically, this would mean that walljumping wouldn't be dependent on wallsliding first; just a jump you can always do when next to a wall.

    Right now (after the update), it's still impossible to turn against the wall before impacting it and walljump. Walljumping should always work when hitting or being next to the wall, not just when wallsliding.

    But anyways, thanks for the update; it's much appreciated how quickly you reply to customer feedback :)

    PS. I would love to see a "low dash/slide" (the kind with which you go through lower, tighter spaces).
     
    Last edited: Jun 25, 2012
  28. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    @Routalanttu
    I will look into that :) Walljumping without sliding is possible.. when sliding is deactivated.. ^^ But should be possible


    Sorry for the late update but it's now submitted.
    I also updated the online demo with the soccer scene!

    Also, I'm working on a full minigame with the soccer assets. This won't be in the framework but should show what you can do without too much work :)


    Ok, that's it for now, have fun!
     
  29. KeepTrying

    KeepTrying

    Joined:
    Feb 23, 2011
    Posts:
    119
    Tested the new demo, that new sample is very fun is like Super Champions :)
     
  30. Monarky

    Monarky

    Joined:
    Oct 2, 2010
    Posts:
    35
    I am having a problem getting a single button to work on screen with android. I am able to get the directional pad to work but the jump button wont work. I assign it in the jump area of the inspector but nothing happens is there something I am missing?

    Also Wanted to say how much I love this Framework nice job. You could of asked twice the amount for it and it would of been worth it.
     
  31. Monarky

    Monarky

    Joined:
    Oct 2, 2010
    Posts:
    35
    Another question with a 2d mario type game whats the best directional controler to use? I am using the stock unity on screen joystick right now any ideas?
     
  32. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Thank for this update Samb ! :) What about option for crouching in nest one ? :))))))))
     
  33. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    @Routalanttu
    I added something that's not exactly what you wanted but should make things easier. "Time for walljump" works nor for after hitting a wall and before hittin a wall. Let's say you're about to hitting a wall, if you pressed the jump button a short time before the impact you will automatically walljump. It makes fast walljumping a lot easier, because you completly skip the wallslide part. Also, I added "must face wall", if unchecked the player don't have to face the wall but can use the walljump and slide when hitting a wall. The only thing to have a bit more of the megaman X feeling would be to set the "min speed for walljump" to zero. that way, you can use walljumping and sliding without any need of speed. Maybe it's not exactly what you wanted but perhaps it will do it's job. If it's still not enough just say a thing and I will try some other things :)

    @Monarky
    Have you tried the template in the ragesplinescene? The last time I checked it everything went without problems. Please see if the ragepslinescene also won't work on your android phone. And thanks for the support!! :)

    I will submit a hotfix in a few minutes.
    - Fixed: Won't lose jumping speed after double jump (check your levels if you now can jump over things that you couldn't before)
    - Better walljump
     
  34. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    186
    Whats planned in the next big version, not these hot fixes?

    Any swimming? Any rope swinging? Any new Enemy AI component (one where you don't jump on the enemy head to kill, and avoid collisions with the enemy)?

    I am getting antsy :)
     
  35. wrocum

    wrocum

    Joined:
    Mar 10, 2012
    Posts:
    1
    Hi Samb88. thank you for what you already did!

    I found a couple of bugs. For better understanding of the problems use these settings.
    for move: "max_running_speed" = 6; "gain_move_speed" = 70; "lose_move_speed" = 50; "stopping_lose_move_speed" = 50;
    for jump: “jump_strength” 16 ; "max_jump_speed" = 6; “jump_force y -30”:

    1) The speed of character doesn't reduce when you release the control button. If you run-up, then jump and at this moment you release the control button, character's speed will remain the same. This is a real problem when you try to jump off the platform edge. The character doesn't fall near the platform as it suppose to be, it continues to move forward because of acceleration. There is a trick in such platform games: several platforms are places one above another, thus once jumped of one platform, you can fly in another platform. Now it is impossible to do like that... Actually, it reacts correct as a physical body but not like a game character.
    2) When you use the «Glide» before the character starts to fall, the meanings sum up, thus character flies up much higher then it supposed to do. Simply press both buttons at the same time.

    Sorry I'm not a programmer at all, but... Here possible solution for a first problem. Рaste this code in "PlayerMovement" script, and you'll see the difference.

    var loseJumpingSpeed : float=13;
    var getAxisInput = true;
    var grounded : boolean = false;

    function Update ()
    {
    //if (Input.GetKey ("right") || Input.GetKey ("left"))
    if (Input.GetAxis(x_axis_name))
    {
    getAxisInput = true;
    }
    else
    {
    getAxisInput = false;
    }

    if(current_mode==playerStates.Jumping || current_mode==playerStates.Falling)
    {
    //if(current_speed > 0)
    if (Vector3.forward != 0)
    {
    if (getAxisInput == false)
    {
    current_speed = Mathf.Max(0,current_speed-(loseJumpingSpeed));
    }
    }
    }
    }
     
  36. VoodooPuppy

    VoodooPuppy

    Joined:
    Jul 13, 2010
    Posts:
    4
    Hey Samb88,

    does this support sprite atlases?

    It would be nice to reduce draw calls over using individual images.

    Great work so far, I'm looking forward to kicking the tires! =)
     
  37. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    @wrocum
    Thanks, I will look into that :)

    @VoodooPuppy
    Sadly I have no idea how to achieve that, but I'm thinking about adding NGUI to the framework, which would support atlases.
    Is there interest in adding NGUI to the framework?


    Ok, to everyone: the next few days, I'm moving out of my appartment and will be back next week. Next up is crouching and making it easier to add new states, right now it's to static for my taste!
    See you next week!

    Meanwhile, you can test the minigame I'm working on! :)
    http://www.bysamb.de/unity/soccer/index.html
     
    Last edited: Jul 5, 2012
  38. parnell

    parnell

    Joined:
    Jan 14, 2009
    Posts:
    206
    Hey Saamb88
    I'd suggest you do something with NGUI. Just for the sake that it's currently a pretty solid UI add-on.
    Can't wait for "crouch"! Here's hoping for a fully MegaMan type control setup.

    I'd like to make a request.
    I want a 'Yoshi' or a pet that would follow me around.
    I figure you could modify the monster AI...but ya. Put that one in your backlog:)
    Thanks!
    B

    btw. This is modeling_man...er was. I updated my profile.
     
  39. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    NGUI this will be nice to have it in this framework ! :)
     
  40. VoodooPuppy

    VoodooPuppy

    Joined:
    Jul 13, 2010
    Posts:
    4
    NGUI would be great, especially if it allows you to support atlases.
     
  41. janio

    janio

    Joined:
    Mar 20, 2012
    Posts:
    8
    Hi Samb!
    What changed since version 1.64? Which files have changed? I have made modifications in some files, and knowing what changed would make my job easier. You can make some release notes for us?
     
  42. RalliP

    RalliP

    Joined:
    Jul 7, 2012
    Posts:
    1
    is there a c# version now?
    Or do I have to convert the code myself?
     
  43. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    Hey all, bad news: my internet connection does not work in the neu appartment. Hopefully they will fix it monday. I will try to continue the work without internet.

    There are my little fixes that make it hard to track everything.. Hmmm. The best would be to save the old version and compare it with the new one (I'm sure there is some programs that can show the difference of two files) I will look for something like that and provide it for everybody.

    There is still no c# version. This shouldn't be a big problem even if every other script uses c#. Right now I'm fixing some "stupid" bugs so taking care of two versions would be painful.. But I will try my best to get a c# version out as soon as possible! At least the main player script files.

    Thanks everyone for your patience! And sorry for spelling errors... I'm typing this with a cellphone :)
     
  44. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Hi Samb, I try to set option in navigation ( joystick ) that when You press the button character will run in one direction ( cant run left side ). I can do this for PC ( turn off left control and use only right one). Maybe some user know how to do this?
     
  45. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    I set x add axis to 1 ( when player is moving all the time ) but when i activate joystick this is not working ( in your example scene "ragespline" too) can you explain to me how to set this to work with joystick ? i need only button for jumping.
     
  46. jittiang

    jittiang

    Joined:
    Jul 24, 2012
    Posts:
    11
    3D Player can't wallslide or multijump on right side wall. I test it on testsceneragespline scene with your 3D Player Prefab and my own. Thank you!
     
    Last edited: Jul 24, 2012
  47. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    I found the way to do what i want :)
     
  48. jittiang

    jittiang

    Joined:
    Jul 24, 2012
    Posts:
    11
    Now I found the problem because in function OnCollisionEnter this line

    Code (csharp):
    1. if(playerMovement.current_speed>min_speed_for_walljump  playerMovement.player_graphic_pointer.eulerAngles.y==90)
    When my 3D character jump to the right wall value of playerMovement.player_graphic_pointer.eulerAngles.y equal to 90.00001 not 90.
     
  49. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    @jittian you're totally right, Added Mathf.Round to that part of the code


    Good news: Everything is in place, I can work again!
    Submitted new version to unity. Now crouching is possible! Yay!

    Please make sure, that in your input settings horizontal and vertical gravity and sensivity is set to 1000 or else you will have a delay.
     
  50. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Perfect ! thank You samb :)