Search Unity

[RELEASED] Complete Physics Platformer Kit

Discussion in 'Assets and Asset Store' started by Greg-Sergeant, Oct 2, 2013.

  1. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Try this to reproduce it : constant rotate script low number like 10 or 5 You need time to stay there for a while :)
     
  2. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I couldn't reproduce, but I figured out why I couldn't reproduce XD

    I added on my update() of my PlayerMove a rigidbody.WakeUp(); so the rigid body would never go to sleep (that's what's happening on your video, the rigid body is sleeping XD)

    So go to PlayerMove.cs

    After: line 83:
    Code (csharp):
    1.  
    2. void Update()
    3.     {  
    add:
    Code (csharp):
    1. rigidbody.WakeUp();
     
  3. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Daniel You Rock !!! Thanks a lot it is working :)
     
    DanielSnd likes this.
  4. CircusCharlie

    CircusCharlie

    Joined:
    Jul 22, 2014
    Posts:
    38
    wow you did a GREAT job. Can you give me your code .. thanks :)
     
    DanielSnd likes this.
  5. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Good call on that rigidbody.WakeUp() there Daniel. :)

    On a different note for those of you interested, here's volume 3 of my video development blog for my platformer which expands on this kit:



    Toward the end of this video dev blog I talk about my abandoned attempt at a dynamic ledge grab system, so if anyone would like to assist to see if we can get it to work, just let me know and I'll share what I have (even though I probably won't use it in my final game at this point anyway). :cool:
     
  6. CircusCharlie

    CircusCharlie

    Joined:
    Jul 22, 2014
    Posts:
    38
    Your work is amazing. How did you make the stomp attack of the player ? Can you give me some pointers? Thanks
     
  7. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    It's all in this thread on the previous pages, specially on page 7, just grab it :D

    Add me on skype, I'd be happy to try and bounce some ideas about it :)

    by the way, what on earth is happening with all those New Game Objects being created and destroyed all the time while he is just walking around? o_O that can't be good for performance
     
  8. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Aww shucks. :blush:
    That was actually heavily inspired by Daniel's punching box mechanics, only instead of being in-front of the player it is below the player. Basically I activate a trigger box that deals damage to anything that enters it upon activating the ground slam ability. And then I apply a negative force to the player to push them downwards.

    I'll take you up on the Skype offer as soon as I reinstall it.

    Those are for the footstep sounds. I needed to be able to control the pitch of the sounds, so AudioSource.PlayClipAtPoint wouldn't suffice. So I expanded on it and am using the following:

    Code (CSharp):
    1.     GameObject PlayClipAtPoint(AudioClip clip, Vector3 position, float volume, float pitch)
    2.     {
    3.         GameObject obj = new GameObject();
    4.         obj.transform.position = position;
    5.         obj.AddComponent<AudioSource>();
    6.         obj.audio.pitch = pitch;
    7.         obj.audio.PlayOneShot(clip, volume);
    8.         obj.audio.minDistance = 15;
    9.         Destroy(obj, clip.length / pitch);
    10.         return obj;
    11.     }
    Each step spawns a new GameObject and then destroys it upon finishing playing the sound. Since Unity's standard PlayClipAtPoint spawns a new GameObject, this isn't too different. I have yet to explore optimizations that can be made to my code and mechanics (really I think this is the only intensive thing that I am doing at the moment), so before I get too much deeper, I'm guessing that this can be optimized by pooling the object? Any tips or leads on using pooling for those to increase efficiency (without using something from the asset store)?
     
  9. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    No seriously don't do that D: IT's bad mmmkay?

    I have a solution I made for my own kit I'm planning on selling soon, I'll send you more information on private :D
     
  10. CircusCharlie

    CircusCharlie

    Joined:
    Jul 22, 2014
    Posts:
    38
    thankls Daniel. you are our hero
     
  11. CircusCharlie

    CircusCharlie

    Joined:
    Jul 22, 2014
    Posts:
    38
    Thankyou so much :)
     
  12. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
     
    CircusCharlie likes this.
  13. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272
    Please post details about your own kit. It should be interesting, I suppose. :)
     
  14. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I think it's not very polite to advertise my kit in someone else's thread for their kit, even though the kits are about different types of games, so I'll just send you some information via private message instead XD
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Bump, so I guess no one ever had this problem? Or it doesn't bother them?
     
  16. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382


    Vertically moving platform works fine here.
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    So maybe it's possible that our character switch out wasn't done quite right. I'll see if we can use the old blocky guy and see if it happens. Thanks!
     
  18. CircusCharlie

    CircusCharlie

    Joined:
    Jul 22, 2014
    Posts:
    38
    Yes Daniel. Send it to me too please, Thanks :)
     
  19. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Non-issue here as well (not using the blocky guy). Even cranking the speed way up to 20 doesn't produce this issue for me; it just launches him upwards when it stops moving.
     
  20. Mad_Fox

    Mad_Fox

    Joined:
    May 27, 2013
    Posts:
    49
    Hi Daniel, love your additions to the kit, can you explain how you make the "4 frame freeze" when your character punch, i really like this subtle effect. Thanks!
     
  21. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I'm using CoreGameKit on this script, and a Trail script, so it won't just work by pasting the whole script into your game, but you can read the script and figure out what I did and copy the relevant parts to yours if you want to :)
    Here is my punching script that I used on Brabo: http://pastebin.com/WZE9vsj4
     
  22. cg_destro

    cg_destro

    Joined:
    Aug 13, 2013
    Posts:
    142
    DanielSnd great work! :) you should collect all your scripts, add couple more and put them in asset and sell as extension to this kit just like acParkour for UFPS or something like this :) This would be good for you and for creator of this kit, you could extend possibility of this kit to create to down shooter, dungeon crawler or something :)
    I would definitely buy this extension :)

    For second I tought that you already did that in your coop Action Game Kit but you probably only use the same main character model like in your videos :p
     
  23. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Some people suggested that, but I don't think it's that much work to warrant actually selling it XD I did it in half a day, most of the scripts are really simple. I'm happy with giving them for free to be included on Greg's Kit ^^

    I reused the model for the Action Game Kit hahahah was too lazy to make a new one XD But my kit doesn't really have an overlap with Greg's kit xD There isn't really a physics or platformer aspect to it, the characters are using Unity's Character Controller instead of Rigidbodies, so despite having a Jump programmed into it, I wouldn't recommend using it to build a platformer. The kit could be used to make Dungeon Crawlers and Top Down Shooters (Well, it comes with a top down shooter already built with it XD) and I'm thinking of making a Brawler/Beat'em up kit based on it in the future.
     
  24. cg_destro

    cg_destro

    Joined:
    Aug 13, 2013
    Posts:
    142
    It's simple to you but not for lots of unity users, but lots of unity users are beginners, hobbyists and amateurs and this could be useful for them and if you can pay like 10-15$ and extend functionality and save couple days it sound like good deal to me :p
    Of course in that case you should make your scripts maybe little more robust, more out of the box solution and add couple more options, you can find wishlist in this thread, users asking for everything from horse riding to boomerang weapons so there is lots of things you could potentially do if you want to :)
     
  25. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Indeed, but the only way to implement some of those features is to change things in Greg's Scripts. And I'm not able to share those scripts after making those changes. Only pieces of the script and instructions on what/how to do. I think an Asset Store pack would be out of question.
     
  26. Mad_Fox

    Mad_Fox

    Joined:
    May 27, 2013
    Posts:
    49
    Thanks Daniel!
     
  27. Riff-Rex

    Riff-Rex

    Joined:
    Mar 14, 2014
    Posts:
    19
    First of all, Greg, this is an amazing kit! Great job! And Daniel, the work you've shared has been so helpful, cheers!

    So, I have a question: How would you go about setting up a variable jump height? That is, the longer you hold the jump button, the higher you'll jump. A quick tap of the key would result in a little hop. Just like (you guessed it) Super Mario 64.

    Thank you so much! I will be sure to credit you in the game I'm working on.
     
  28. CircusCharlie

    CircusCharlie

    Joined:
    Jul 22, 2014
    Posts:
    38
    Hey Daniel... How are you ? I wanted to know where you got this character from ? can you give me the link ? or is it your own creation. If yes, is it for sale ? Thanks :)
     
  29. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I did it on Brabo, but I had to change PlayerMove.cs to do it, discaring the 3 different jump-heights, so... Not that easy to share, I would have to write instructions on how to do it, and I'm lazy D: Basically you'd have a bool to check if the button is being pressed still, so it'd go TRUE when button down, and FALSE when button up. If it was false and it turned True mark the current Time, the on update check if the bool is TRUE and time is more than a desired ammount to do the higher jump, if it is, do the higher jump and turn the bool to false. Meanwhile, on Button Up, if do the lower jump is true, it means not enough time has passed so just turn the bool to false and do the lower jump.

    It's my own creation :D It isn't exactly for sale, but a variation of it is available on the kit I'm selling on the asset store.
     
  30. Riff-Rex

    Riff-Rex

    Joined:
    Mar 14, 2014
    Posts:
    19
    Thanks. Still working on it, but that helps.
     
  31. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Really awesome kit.

    Will there be a new version or update soon. From the asset store it seems that the last version was in Jan 2014.

    Cheers.
     
  32. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Question: Does anyone know which mobile control package from the asset store works best with this package.
     
  33. MaToPi

    MaToPi

    Joined:
    May 3, 2013
    Posts:
    3
    Do any of you guys already found a solution for the slopes and the character sliding?. I've seen a couple of recommendations in the thread but none that works as charmingly well as, lets say, the first person controller in unity...
     
  34. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    I guess I'm not sure what the issue is (or how the first-person controller slopes "feel") but I did wind-up having to increase the force being applied to the Player while on a slope to about 75 to actually prevent them from (slowly) walking up steep slopes.
     
    Last edited: Aug 12, 2014
  35. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I was talking with Besus and I just noticed I never posted an old game I made with the Complete Physics Platformer kit over here.

    http://gamejolt.com/games/platformer/box-party-turbo/18972/

    This is Box Party Turbo, it was made for a Game Jolt Gamejam with the theme Party, but wasn't finished in time. Levels are semi-randomly generated. The idea is that the party is about to start and you need to go down to the basement and pick up the drinks and food. Pick up the drinks by solving some randomly picked platforming challenges and get back at the party :D

     
  36. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    For those interested, I present volume four of my video development blog series following development of my 3D Unity Platformer - Besus: Journey for Vitality!
    Updates focused-on in this volume include:
    • Health Pickup
    • Save/Load System (with potential for infinite save slots)
    • Falling (timed) platforms
    • Level-specific Powerup Card Activation buttons
    • Dialog System
    • Fall Damage (varying amounts depending on height)
    • Differing level start points (if entering the level from a different location)
    • Level development progress
    If anyone would like additional details on how any of these were implemented, don't hesitate to ask! :)

     
    DanielSnd likes this.
  37. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Awesome! :D Looking good

    In other news...

    Greg's new game is out! :D

    http://greg-anims.com/?p=1383
     
  38. David-T

    David-T

    Joined:
    Oct 6, 2012
    Posts:
    11
    Control Freak has a controller prefab specifically for the Complete Physics Platformer Kit and it is only $10. I have tried it out and it seems to work well.

    https://www.assetstore.unity3d.com/en/#!/content/11562
     
  39. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Thanks for the info on Control Freak and CPPK integration.

    Can anyone share when CPPK will be updated?

    Cheers.
     
  40. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    So I encountered a strange issue with this kit which I recall having experienced when I first got it as well when not using VSync (Project Settings/Quality/VSync Count = Don't Sync) which I wanted to share the fix for.

    The problem which I encountered is that enemies move VERY slowly toward the player when VSync is off and found that this is the result of the TriggerParent script getting "out of sync" with the EnemyAI script. I'm not 100% on the details regarding if OnTriggerStay is being called on Update or FixedUpdate but it is basically causing the enemy to stutter moving toward the player as the if statement (if (sightTrigger && sightTrigger.colliding)) which controls their movement is seemingly cutting in and out.

    Checking the TriggerParent script I found:

    Code (CSharp):
    1.     void LateUpdate()
    2.     {
    3.         colliding = false;
    4.         collided = false;
    5.         hitObject = null;
    6.     }
    Which was causing that if statement controlling the movement in the EnemyAI to "flicker" on and off basically. Moving the colliding bool from LateUpdate() to OnTriggerExit resolved this:

    Code (CSharp):
    1. public class TriggerParent : MonoBehaviour
    2. {
    3.     public string[] tagsToCheck;            //only check for collisions from objects with these tags
    4.  
    5.     [HideInInspector]
    6.     public bool collided, colliding;
    7.     [HideInInspector]
    8.     public GameObject hitObject;
    9.  
    10.     //see if anything entered trigger, filer by tag, store the object
    11.     void OnTriggerEnter(Collider other)
    12.     {
    13.         if (tagsToCheck.Length > 0)
    14.         {
    15.             foreach (string tag in tagsToCheck)
    16.             {
    17.                 if (other.tag == tag)
    18.                 {
    19.                     collided = true;
    20.                     hitObject = other.gameObject;
    21.                     break;
    22.                 }
    23.  
    24.             }
    25.         }
    26.  
    27.         else
    28.             return;
    29.     }
    30.  
    31.     void OnTriggerStay(Collider other)
    32.     {
    33.         if (tagsToCheck.Length > 0)
    34.         {
    35.             foreach (string tag in tagsToCheck)
    36.             {
    37.                 if (other.tag == tag)
    38.                 {
    39.                     colliding = true;
    40.                     hitObject = other.gameObject;
    41.                     break;
    42.                 }
    43.  
    44.             }
    45.         }
    46.  
    47.         else
    48.             return;
    49.     }
    50.  
    51.     void OnTriggerExit(Collider other)
    52.     {
    53.         if (tagsToCheck.Length > 0)
    54.         {
    55.             foreach (string tag in tagsToCheck)
    56.             {
    57.                 if (other.tag == tag)
    58.                 {
    59.                     colliding = false;
    60.                     hitObject = null;
    61.                     break;
    62.                 }
    63.             }
    64.         }
    65.  
    66.         else
    67.             return;
    68.     }
    69.  
    70.     void LateUpdate()
    71.     {
    72.         if (collided)
    73.         {
    74.             collided = false;
    75.             hitObject = null;
    76.         }
    77.     }
    78. }
    This should keep any functions tied to checking for colliding and collided respectively intact. :)
     
    Last edited: Aug 20, 2014
  41. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Hope that this awesome kit is not going to become Abandon Ware.
    Please provide some info regarding future updates ? Appreciate it.
     
  42. GiusCo

    GiusCo

    Joined:
    Aug 1, 2009
    Posts:
    405
    What do you need in particular from an update, rocki? The kit is ok as it is and Unity 4.6 will not make it out of date. Coupled with the Control Freak asset, we have time and space to release our game before the Unity 5.0 overhaul.
     
  43. Greg-Sergeant

    Greg-Sergeant

    Joined:
    Feb 18, 2011
    Posts:
    76
    Abandon Ware? Definitely not, in fact, from the looks of the forum lately i'd say the kit is thriving like never before!! :D

    Guys i hate to plug stuff, but i just finished a brand new game (its actually my first retail game!) and if you enjoy my work, you can CHECK IT OUT HERE



    You can also find it on GREENLIGHT

    thanks guys! Happy platforming :)
     
  44. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Heck I would be willing to bet that it would work just fine with Unity 5 as well.

    Rocki,
    The kit is certainly easy enough to expand on though (as Daniel has proven with his scripts) so I too am wondering what functionality you feel would be a necessity for this kit.
     
  45. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I totally agree, I can't see this becoming abandonware unless it stops working in a new unity update. I don't see the exact NEED for an update at this point. Of course it's always nice to get new things added, but it's not to be expected, we bought the kit for the features that were announced.
     
  46. elizeusz

    elizeusz

    Joined:
    May 2, 2012
    Posts:
    49
    Thank You Besus i had the same problem with very slow enemies when Vsync was off and Your solution helped me ! :)
     
  47. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
  48. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    Excel.lent kit! But I have an unexpected problem jump behaviour.
    I have in my game these three jumps configured in the inspector:
    1rst jump: X:0, Y:13, Z:0.
    2nd jump: X:0, Y:13, Z:7.
    3rd jump: X:0, Y:0, Z:0.
    But we need to consider that any jump, (1,2 or 3) do not surpass the 13Y of height.
    And it works all fine, I can jump 13 units in height, so I can design my game according this.
    But when my jump is executed in an area, just where two walls meet, my jump is like 13+5=18Y of jump!.
    This problem has been tested on various two walls/geometry forming and angle of 90º.
    Then, my puzzle game makes no sense if the player can jump higher in the corner!
    In the images, you can see the difference of height jump in the same scene, but executed the jump in a different position.
    Can someone help me? Thank you all.
     

    Attached Files:

    Last edited: Aug 22, 2014
  49. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    After you pointed it out, I noticed the same thing both with my project as well as the base (unmodified) kit. I tried playing with the rigidbody, the velocity settings in PlayerMove, and the FloorChecks (even modifying the grounded Raycast to cast from the center transform instead of using the floor checkers) with no luck. So at this point, I really don't know how this could be resolved.

    Something tells me that this is related to the physics system in Unity itself and not in the Physics Platformer kit...
     
  50. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    Thank you for your try. If you haven't got luck, I doubt someone else could resolve this. :(