Search Unity

[RELEASED] Complete Physics Platformer Kit

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

  1. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    Just from the regular ui that they used in the demo. I'd imagine 2 NGUI label box's and 2 link to them from the script would be about all u needed then set them from a variable used by the project.
     
  2. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Yup, pretty much. So instead of:
    Code (CSharp):
    1. GUILayout.Label ("Health: " + health.currentHealth);
    You'll now need to create a variable to reference the NGUI element and then assign the health value to it where necessary:
    Code (CSharp):
    1. public UILabel healthLabel;
    2.  
    3. healthLabel.text = health.currentHealth.ToString();
     
  3. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
  4. trintasegundos

    trintasegundos

    Joined:
    Jan 9, 2015
    Posts:
    3
    Hello. This pack seems amazing.
    Does it have mobile controls?
    thank you
     
  5. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    No, it does not.
     
  6. cleverweek

    cleverweek

    Joined:
    Nov 17, 2014
    Posts:
    32
    Is this product abandoned? No updates for a year!
     
  7. Neoshiftr

    Neoshiftr

    Joined:
    Dec 5, 2012
    Posts:
    67
    Same question. Jump Bug (you can slide up walls) prevents me using this kit.
     
  8. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    This kit has a lot of bugs... This jump bug, jumping from a moving platform, sometimes the player "fly", near the head of an enemy without killing him...
     
  9. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    A lot of these are the result of how the physics engine in Unity handles things. Some coding workarounds can alleviate nearly all of these; except for the corner jumping "bug".
     
  10. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    I just found out that if you add a rigidbody component to the walls (make sure to set it as Kinematic and turn off Gravity), the player no longer jumps/floats higher while running in to that corner of the walls. This tells me that it is something with the physics system in Unity and not with this kit. As for a workaround that doesn't require a rigidbody to be on the walls, that's still a work-in-progress. :)
     
  11. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    Good lie, Besus...
     
  12. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    You add a kinematic rigidbody to the walls and suddenly the player doesn't double their jump height. The only way code could affect this is in the OnCollisionStay function.
    But clearly you know something here that I do not, so please, elaborate...
     
  13. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    Didn't work.... Wait forITGeist, it should reply, commenting the result.
    I thought it did not work, because my wall meshes is build with probuilder. Then I've tried with walls-cubes from the Unity itself... NO result.... All I do is: Add a rigidbody component, and check "Is Kinematic", and uncheck "Use Gravity", for both walls forming their angle of 90º. My jump in the corner is more higher than normal, the problem continues
     
  14. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Then you must have something else interfering somewhere. I just did it in both my current project (on ProBuilder objects none-the-less) as well as a brand-new one with nothing more than the core Platformer kit contents and it prevented the heightened jump every time.
     
  15. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    Only one more thing about this jump-thing. You are the one who assist people here with general answers (but helpful) and sell answers concrets in form of a scripts? Can I send you my project of one level only, and fix the jump-corner-walls problem? (and tell me what to do to fix the other levels). And tell me how much it costs. Because it's obvius, your answer of adding rigidbody to the walls, check kinematic and uncheck gravity, didn't work... Or upload a neat project..
     
  16. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226


    I promise I wouldn't lie. Brand-new project, showing both the before and after applying a Rigidbody to a wall.

    Until you can show me a 3D "platformer" project in Unity 4 where this doesn't happen, I'm putting the blame on the physics engine.
     
    Last edited: Jan 19, 2015
    Fowi likes this.
  17. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    In addition to the above video showing that the rigidbody wall jump "fix" does work, I present after 4 long months video development blog: volume 6.

     
    Fowi likes this.
  18. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    I have to say: Very Thank You. You saved my life.... lol.... I was doing it wrong.... Now it works.... See you another time... Thank you...
     
  19. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    I'm starting on a 2.5D game, where in most cases you want the character to flip from left to right immediately when changing directions. Setting a high rotation speed on PlayerMove handles this well enough but it causes problems with picking up objects. All sorts of crazy things happen when changing directions while holding a crate. I even tried setting the Holding Break Force settings all the way up, but its still happening. Anyone know a good way to fix this problem?
     
  20. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    I can't say that I experienced this or was able to recreate it (maxing out the rotate speed and leaving the break force at its default value). I can however say that I experienced weird issues with the joint created when the box that I was picking up was somewhat in the ground. Maybe try raising the crate up a bit in the scene so it falls a tiny bit at the start.
     
  21. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    Are you using mechanim or Legacy animation system.
    I am interested in making a 2.5D Scroller game. The demo scenes are super marvelous but can I place a character of my own or I have to stick to the default box shape?
     
  22. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    @Besus, for me I think the problem was the rotation constraints I put on the rigid body of the crate. I didn't want to be able to push the box and have it rotate out of the way. Constraining position works well enough for this so I was able to remove the rotation constraint and get the desired effect.

    @Adnan2012 You can replace the character with your own. I think it would need to be mechanim if you want to use the code as is. Let me know over PM what sort of game you are making, maybe we can team up.
     
  23. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    I tried this and thought it worked great also. But then I got hit by an enemy while on a slope and my character shot up in the air and of course will not start falling again until I move. :) Guess we should also turn gravity back on when getting hit... this is getting a bit messy.
     
  24. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Doing the following in PlayerMove::FixedUpdate seems to work, and this way we can have all code changes in PlayerMove instead of also changing code in CharacterMotor and DealDamage.

    Code (CSharp):
    1. float dirMag = direction.sqrMagnitude;
    2.         if ((rigidbody.velocity.y > 0 || dirMag > 0) && !rigidbody.useGravity)
    3.         {
    4.             rigidbody.useGravity = true;
    5.         }
     
  25. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Right, I never constrain rotation on objects that you can pickup, so for the sidescroll sections I just constrain the object position on the Z-axis.

    I was able to implement this as well, but no doubt that there are a few places that you'll need to work out where it gets turned on and off. I found adding:

    Code (CSharp):
    1.     void OnCollisionExit(Collision col)
    2.     {
    3.         if (!specialConditionsUniqueToMyGame)
    4.             rigidbody.useGravity = true;
    5.     }
    To PlayerMove works well to alleviate a lot of those "fly up in the air" moments.
     
  26. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    WOW, more persons than Besus are here aporting solutions...
    Interesting to resolve "fly up in the air" moments, but I have this in very little moments.
    Here is a problem I have, (anyone more than me?):
    My enemies only are playing the animations idle and move. In a 100%.
    My enemies often evade attack animation, Especially the three last enemies added, they are directly not playing attack animation never. The specific attack animation is asigned in the specific mecanim controller for each enemy. The attacks animations has the same options checked as idle and move: loop time, loop pose, root transform rotation / postion yxz
    I don't know why... but this is (the last for me) a big problem...
     
  27. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    You need to play with the settings in the animation tree. Toggling "Atomic" on and off, adjusting the blends, and using "Exit Time" to ensure an animation gets played. I dealt with that too, and it's a result of Mecanim blending so quickly that you never see the attack animation before it goes back to idle/moving. Changing the code in EnemyAI to play the state (animator.Play("Attack") to instantly play that animation) for example instead of just setting a bool in the animator would also be a workaround to ensure that it plays the attack animation.
     
    Fowi likes this.
  28. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    I changed the condition of the transition from attack to idle for "Exit Time". And now is playing the animation!!!. I changed the speed of the animation from 1 to 2, and works very correct!!!. You are a GOD! And if I correct a littlethe blending it could be more better... Thanks from the bottom of my heart...
    Edit: I added too, a StartCourutine with WaitForSeconds(0.1) and later do the attack in EnemyAI Now the animations are perfect!
     
    Last edited: Jan 23, 2015
  29. blackorchidgames

    blackorchidgames

    Joined:
    Jan 6, 2015
    Posts:
    8
    Hi.
    I am using the Complete Physics Platform Package as a building block for my upcoming game project. To cut to the chase, I want to use the included damage and health scripts, since they are so well implemented. However, my character is a magician who deals damage only via spells, which are actually particle prefab effects which he shoots from his staff. No jumping on enemies :)

    My question is: Will this kit allow me to attach the damage scripts to a particle prefab, so that when the particle hits the enemy it will deal damage? I know there is a way to accomplish this with Playmaker, as well as within Unity itself, but I'd like a more elegant solution that fits in better with the current scripts of the package. I looked into trying this with Daniels projectile shooter add-on, but I'm not sure if that is the best way to do it? Perhaps I could attach the prefab to this script and the rest would be taken care of?

    This still does not take care of the issue were the 'ring of fire' effects around him should also deal damage though, since that isn't really a projectile.

    Thanks in advance :)
    - Landon Parks
    Black Orchid Games.
     
    Last edited: Jan 26, 2015
  30. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    Have you planned to implement a method to let the character not only run on platforms but also on 360° surfaces like planets, cubes etc.?

    It would be f*** awesome to get this out of the box with a few clicks! :)
     
  31. blackorchidgames

    blackorchidgames

    Joined:
    Jan 6, 2015
    Posts:
    8
    What is it exactly you want it to do? the kit can already perform most of the basic physics interactions, and that seems pretty standard to me. I take it you mean, for example, the character being able to run on the top of a wheel shape? Something like this should already be possible with the standard settings although I have not played with that yet.

    All you really need to do is set the physics of your wheel to is kentic, and it should allow your character to walk around the 360 degree surface, even moving the wheel along if the forces are set right.

    I'll test this theory out here in a minute and let you know.
     
  32. blackorchidgames

    blackorchidgames

    Joined:
    Jan 6, 2015
    Posts:
    8
    I have tested and confirmed that it does, in fact, work. At least it does if you mean what I think you mean. If your trying to get the character to roll with the object, similar to riding the top of a tire, just add a rigidbody to your cylinder and select use gravity and un-check is kinematic. Your character will then be able to run over cylindrical objects, and they'll move as he walks.

    If you've ever played Trine 2, you'll know this similar effect when you have to roll logs to jump onto. Very similar.
     
  33. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    I think he is looking for more of a Mario Galaxy style faux gravity. This can be accomplished fairly easily actually:


    Yup, so long as your particle object has a collider attached then you can set the collider to isTrigger and attach a DealDamage and Hazard script. Then when it hits whatever object you want to inflict damage to, it will deduct health and push them.
     
  34. blackorchidgames

    blackorchidgames

    Joined:
    Jan 6, 2015
    Posts:
    8
    I think I may have found a bug in the script. It could be a physics issue with Unity rather than a bug, but: In testing out the theory above about the cylinder, I also tagged it as 'pick up'. I tried both a capsule and mesh collider, and in both cases when the characters picks it up, he shakes violently and will randomly jump off the map.
     
  35. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    If that cylinder has the hazard/dealdamage scripts on it, you will need to exclude the Player from taking damage from it or else it will be pushing them while they hold it (and with the joint, the 2 will be fighting). Otherwise the mass on that object may be too high.
     
  36. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    Yes, I meant sth. like that Besus wrote. Running around planets for e.g. but with all the cool features of this package.
     
  37. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    You'd just have to apply that gravity logic to all of the other rigidbodies in this kit and you should retain all of the functionality you speak of. :)
     
  38. Zirind

    Zirind

    Joined:
    Jan 27, 2015
    Posts:
    2
    Besus, I was wondering how you made your heightmap? Looking at your level one (with the windmills), its really well done. I'm having a lot of trouble gauging how to paint the grayscale image to make it come out looking nice
     
  39. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Thanks! I just used the built-in Unity terrain tools; no imported heightmaps.
     
  40. Zirind

    Zirind

    Joined:
    Jan 27, 2015
    Posts:
    2
    Wow, I have a hard time making things look smooth with it. I guess I should just practice with them some more.
     
    Last edited: Jan 28, 2015
  41. IntegraC

    IntegraC

    Joined:
    Jan 20, 2015
    Posts:
    16
    Greetings. After reading this thread I decided to go ahead and purchase this kit. As has been said many times, it's a very amazing kit. However before I start adding my own assets, I want to make sure the basic controls are tweaked to my needs.

    I added inputs for controls via a controller, but the one thing that is baffling me is how to get the camera to stop focusing on the cube's 3/4 rear view instead of fully on it's rear. I added the line of code that was suggested to the SmoothFollow() function in the CameraFollow script, but that just spins the camera round and round, same as if I check of LockRotation in the inspector.

    Also, has anyone changed CamHorizontal so that it doesn't reset the view? Sort of like in World of Warcraft, where you can rotate the camera and leave it where you rotate it, instead of it resetting on your rear. This way you could technically run blindly ahead (as the camera would be focused on what's behind you) and you could see what's chasing you.

    Any suggestions on what direction I need to be looking, would be appreciated.
     
  42. blackorchidgames

    blackorchidgames

    Joined:
    Jan 6, 2015
    Posts:
    8
    Okay, another issue. This is more to do with Daniels projectile add-on, but maybe someone will have an idea. I'm trying to attach a prefab particle system as the projectile, and I'm running into all kinds of issues. Namely, the particles simply do not show up. The projectile shoots, and you can see the results of the damage, but can't see the projectile. I messed around with the collider box, and I think the issue is in my selection of collider. The script says I need to assign a collider with isTrigger. I tried many of the collider options, but get the invisible projectile problem. I once set the collider as a mesh - and I could see particle now, but it did not damage. I tried box and when I shot it, it sends my player flying across the terrain. Does anyone have an idea how to assign Daniels Projectile script to a particle prefab in a way that will work?

    I even tried assigning the particle to a game object and a cube, and applying the scripts, etc to that rather than the particle. But still the same thing...
     
    Last edited: Jan 29, 2015
    Fowi likes this.
  43. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Not sure what you all changed, but the camera should stay where you move it (unless it collides with something, even then it moves as close to its original destination as possible). What line of code did you add to SmoothFollow()? The camera works exactly as it does in the web demo on the asset store page, so as long as your input settings treat CamHorizontal as an axis, nothing should change from its original functionality.
     
  44. IntegraC

    IntegraC

    Joined:
    Jan 20, 2015
    Posts:
    16
    I ended up redoing the Inputs for the controller from the start. Not sure what I did different, but now it works. Thank you.
     
  45. BokuDev

    BokuDev

    Joined:
    Jan 2, 2014
    Posts:
    81


    Some Co-op Tests of these!



    See-saw's GIF/MP4 EXAMPLE

    http://i.gyazo.com/73d3c3b58a643d93426128077f08b1f3.mp4


    Balance Beam GIF/MP4 EXAMPLE
    http://i.gyazo.com/acad13fcdc4a7c79d6b819789dc6bd0f.mp4


    So iv been experimenting with all those idea's and they all worked right away besides the modification of the throwing script. (Will continue to polish though) Still a lot of fun to pull off, and is nice to show some co-op examples with the PPK, but the throwing script modification only makes it so once P1 throws P2; the next time P2 jumps he gets rocketed in the air big time or P2 can help P1 fly by spamming the jump button while P1 is holding P2 :D will keep up with it though and fix it with time!

    GIF/MP4 EXAMPLE OF BUG:
    http://i.gyazo.com/d74049a0d7e6db97e5912c38479990a8.mp4
     
    Last edited: Jan 30, 2015
  46. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    That's looking really good. I'm pretty anxious to try out something playable for this!

    On a side note, my attempt at recreating the "snappy" feel of the ledge grabbing in Mario 64 is coming along quite nicely. I am now able to grab on to dynamic objects as well (please ignore the fast speed of the gif :cool:):
     
    joaobaltieri, BokuDev and Fowi like this.
  47. blackorchidgames

    blackorchidgames

    Joined:
    Jan 6, 2015
    Posts:
    8
    Alright guys, I figured out the issue I faced earlier in regards to the projectile script, and how my particle was not showing up. Just in case its helpful to anyone else, here are the steps to make this work correctly:

    How to add particle projectile

    1. Add script ‘PlayerRanged’ to Player.

    2. Create a new particle effect to be used as projectile.

    3. Add the script ‘ScriptProjectile’ to the particle effect.

    4. Add a ridgedbody to the particle, uncheck ‘use gravity’ and check ‘is Kenematic’.

    5. Add a Sphere collider to the particle, check ‘is Trigger’.

    6. In the particle effect, under the ‘ScriptProjectile’ section, drag the player model into the area labeled ‘Owner’.

    7. In the Player, under ‘PlayRanged’, drag the particle effect as the projectile object.

    8. Add a new GameObject, and parent it to the point at which you want the origin of the particle projectile.

    9. Open the player object, and under ‘PlayerRanged’, drag the game object to the box titled ‘spawn position’.

    Hope its helpful :)
     
    Fowi likes this.
  48. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    Wow, thanks for this, maybe I will implement that in the future in my game. For now I will release my finished game with Complete Physics Platformer Kit (and very modified), in Standalone and mobile...
    ahh... Is Daniel Alive? >:>) because he don't participates as much as before. [:-D. And their skills is a gem!
     
  49. BokuDev

    BokuDev

    Joined:
    Jan 2, 2014
    Posts:
    81
    Thanks! That ledge grab is another one of your scripts that have me foaming at the mouth to have as well! haha
     
  50. IntegraC

    IntegraC

    Joined:
    Jan 20, 2015
    Posts:
    16
    Anyone successful in using a sphere or capsule collider vs the box collider? I switched colliders, and moved the Floorchecks accordingly as to half the height of the new collider, and it didn't work.