Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

[RELEASED] Complete Physics Platformer Kit

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

  1. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    I believe Greg has stated that he would only do bug fixes should something in the kit break in future Unity releases.
     
  2. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    418
    Well, this counts as a bug:
    It didn't use to happen in the past.
     
  3. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Ha, and the funny thing about that is I recall being able to do that in 4.x as well. Maybe it didn't freak out as much as 5.x, but I swear you could always twist it off.
     
    Frpmta likes this.
  4. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    418
    Now that you mention it, I call it bugged now, but it was also bugged before that in the sense by twisting you could go back which is also a fake physics behaviour even if it does not feel broken haha.
     
  5. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Messing with this again, that is happening because there are no break limits on the joint. If you update the Throwing script to implement these break limits again, using 1000 for both force and torque limits prevents this (and causes the player to simply let go) while still being able to hold on to the pickup item. I haven't noticed any adverse effects of reverting this as a result of this with anything else (including pushables). This is with 5.6 however.
     
  6. thehoneyrabbit

    thehoneyrabbit

    Joined:
    May 3, 2013
    Posts:
    54
    Hi guys i love the kit, how would i implement a heart sprite for the gui instead of a number. i have been searching for days if anyone can link me a tutorial in c# let me know!!
     
  7. bonikill111

    bonikill111

    Joined:
    Jul 27, 2015
    Posts:
    7
    Been Hiding in the thread for a while :p I think I have found a decent solution to sliding on slight slopes while playing around with the gravity. In PlayerMove in OnCollisionStay where the Rigidbody.velocity is set to zero add another line underneath:

    GetComponent<Rigidbody>().Addforce(Transform.up*the opposite gravity of your physics settings)

    So if your Gravity is set to -9.81 (real world gravity for example) it would be:
    GetComponent<Rigidbody>().Addforce(Transform.up*9.81f);

    Also GetComponent is slow so the Rigidbody should be stored, making it something like: PlayerRb.Addforce(Transform.up*9.81f);

    If the mass of the Rigidbody is over 1 then you have to multiply the gravity by the mass as well. So if the mass is say 2.5.
    PlayerRb.Addforce(Transform.up*9.81f*2.5f);

    If you play with the minimun velocity.magnitude in the if statement you can fine tune it further, instead of saying velocity.magnitude < 2 try velocity.magnitude < 1 or 3.

    This essentially makes the player weigh nothing so gravity has no affect.

    This seems to work ok for me as long as the player is idle and not already sliding or has some external force being applied to them, still testing though.
     
    Last edited: Apr 18, 2017
  8. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    If I recall, there was a few posts dedicated to resolving this issue a few pages back. You could probably find it by searching this thread for slopes or sliding (or something similar).
     
  9. bonikill111

    bonikill111

    Joined:
    Jul 27, 2015
    Posts:
    7
    Im not asking for a solution to the problem Im giving one lol
     
  10. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Sorry, I should have elaborated on why I brought that up. It can cause jittering to counter the gravity with another force when you could just turn off the gravity - like the other work around posted. In addition using OnCollisionStay is expensive to check for that sort of thing (since it will query and compare all collisions occurring every fixed frame).
     
  11. bonikill111

    bonikill111

    Joined:
    Jul 27, 2015
    Posts:
    7
    Hmmm I havent encountered any jittering at all so far as long as I account for the rigidbody mass, I have lots of objects pushing and moving my player around. If another force moves the player the if statement checking rigidbody.velocity should stop the transform.up force from being applied stopping the jitter. OnCollisionStay is already being called regardless of my addition of one extra line of code, no more performance loss I think than setting the rigidbody.velocity to zero on a fixed time step, which it already does. In the Profiler window Physics.ProcessReports.Contacts there appears to be little to no difference in performance. Enabling and disabling the gravity caused a lot more problems for my project. The other solutions I tried but they ended up failing me in some way, Just trying to figure out the best work around for this issue. at least for my own project.

    Also Besus you appear to be the go to guy for many issues on this forum :p I appreciate your input on this. You have helped a lot of people with this kit including myself!
     
    Last edited: Apr 19, 2017
  12. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    *Blush* Well thanks!

    I actually had the opposite experience with jittering and such with the player. To be fair though, I haven't explored that in a few years so I likely coded it badly back then. :oops:

    The more solutions the better though and it definitely sounds like you know your stuff (and did your research)! :)
     
  13. bonikill111

    bonikill111

    Joined:
    Jul 27, 2015
    Posts:
    7
    The Physics Platform Kit, watching your videos, Unity tutorials, Google and You-Tube is basically how I learned to script :) I have added way more to this kit than what was ever on it to begin with, Including ledge grabbing and climbing along a ledge,wall jumping, pole climbing, boomerang throw and my favorite trapeze/vine swinging (which took forever and is still a bit buggy) and much more. I am a big fan of 3D platformers and am working hard to make one of my own. But I'm still learning and know my code needs a lot of work :p
     
  14. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Sounds like you're off to a great start! This kit is what motivated me to learn Unity/C# as well and I instantly fell in love with both.

    I look forward to seeing what you're making (blog post, video, etc) so please share it when you feel it's ready. :)
     
  15. DrDoggo

    DrDoggo

    Joined:
    Apr 26, 2017
    Posts:
    1
    Can any of you guys send me the demo? The Drop Box link for the demo is down. :0
     
  16. bonikill111

    bonikill111

    Joined:
    Jul 27, 2015
    Posts:
    7
    Don't have a demo but DanielSnd made a neat little game a while back that uses this kit, called Box Party Turbo. He pasted a link to it in some earlier posts, you could try that...
     
  17. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    58
    Hello guys.

    Is anybody getting this error in Unity 5.6?

    "In order to call GetTransformInfoExpectUpToDate, RendererUpdateManager.UpdateAll must be called first"

    I've found that it has to be with the interpolation in rigidbodies and setting them to None doesn't make the message go away, but disabling the MoveToPoints script does.

    Don't know what to do there :/
    The game still playable though.
     
  18. bonikill111

    bonikill111

    Joined:
    Jul 27, 2015
    Posts:
    7
    I've been getting this to for quite a while. All I could find on it is this:

    https://forum.unity3d.com/threads/i...manager-updateall-must-be-called-firs.459144/

    https://issuetracker.unity3d.com/issues/errors-message-at-editor-play

    Hopefully it will be fixed in the next release....In the MoveToPoints script in Awake it sets the Rigidbody to interpolation. So if you turn it off before you hit play it just resets to use interpolation. I Just noticed that when I pan my camera the error count seems to go up faster in certain areas. If I put my camera under a plane that the player stands on it stops. Very strange maybe it has something to do with the camera rendering objects with the MoveToPoints script on them??
     
    Last edited: May 16, 2017
  19. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    58
    Thanks, I found those threads too but is not really a solution.

    Tried Unity 5.6.1 but the issue was not fixed, so I'll just have to wait and see.
     
  20. Lilconiglio

    Lilconiglio

    Joined:
    Jan 24, 2017
    Posts:
    1
    Hi guys,
    So is this kit updated to work on the last unity version?
    If not, is there a similar kit on the store that is updated?

    Thanks!
     
  21. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    58
    Hi. It does work fine. The issue we're reporting is a Unity known issue since 5.6 and will appear on any rigidbodies with interpolation (as I understand). Is not a problem that comes with the asset.
     
  22. nicolasbulchak

    nicolasbulchak

    Joined:
    Aug 9, 2013
    Posts:
    37
    Hey guys, I just wanted to stop back in and say thanks to all of you for helping me learn so much in unity. Especially Besus and Danielsnd. We are no longer using the Physics 3D platformer, but it was so helpful in getting us up and running in the prototype stage. We are now doing some public game testing on our first level. Totally wouldn't of ever got there without the regular support and encouragement from this thread
     
    DanielSnd and Besus like this.
  23. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    321
    So I've got my eye on this, but I notice that it is no longer being updated with new features.
    The demo link is broken and there are way too many pages for me to read through to find answers to my questions, so I'm just gonna ask.

    Were any of these features ever added:
    -ledge grabbing
    -long jump
    -box stacking (instead of throwing)

    Are there any problems with moving platforms? I've seen a number of Unity games/demos where there is a slight lag between a moving platform and the player standing on it, especially with platforms moving down (the player falls slightly each frame) or with platforms that move too fast.
     
    Last edited: Sep 25, 2017
  24. d-3

    d-3

    Joined:
    Oct 18, 2009
    Posts:
    202
    Use the Parent function on moving platforms
     
  25. nuonical

    nuonical

    Joined:
    Feb 28, 2015
    Posts:
    37
    No ledge grabbing that I'm aware of. Long jump is easy enough, and box stacking should be simple as well. For moving platforms it depends on your level requirements. As d-3 mentioned, parenting your player to the platform works well. I change the players friction material and the moving platform material when grounded, and that works as well. Just depends on what you need. I'd say try the parenting method first as it's simple and very effective, then go from there.
     
  26. RyroXD

    RyroXD

    Joined:
    Apr 21, 2017
    Posts:
    3
    Hey @Yog-Shoggoth , I know this is very out of the blue, but I noticed that a while back (3 years XD) you posted a video where you managed to make a walljump for this pack using vector3.reflect and I was hoping you could share your code (If you can be bothered) with me. As I am trying, unsuccessfully to make my own wall-jump script and I'd love it if you could help me out :p
     
  27. elijahrockshout

    elijahrockshout

    Joined:
    Apr 6, 2013
    Posts:
    9
    If I'm not mistaken, the flash object should be your player characters mesh. If your player character is made up of several meshes (i.e. body, face, hair) I don't know how to get multiple meshes to flash, unless anyone else knows how to do it.
     
  28. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    This. It should be the (Skinned) Mesh Renderer for your character. This is what blinks the flash color when they are damaged.
    If there are multiple you want to blink, you'll have to edit the Health script to make the flash object an array, and then update the code where it toggles the colors to loop through that array so it blinks all of them.
     
    elijahrockshout likes this.
  29. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,117
    Hi @Besus
    I changed character collision cube to a capsule collision, but the animations are no more playing.
    Do you know what is causing that ? I remember it was some variable length perhaps about checking floor.
     
  30. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Yeah you may have to extend out the raycast check length to check if the character is grounded or not (though if they are not, it should play the falling animation non-stop).
     
    zenGarden likes this.
  31. alongkorn59

    alongkorn59

    Joined:
    Jun 29, 2017
    Posts:
    1
    upload_2017-12-10_23-50-43.png

    How to fix
    i cant pick up boxs
    but frame I can pick up and can Pushable
    how to fix pls help me.
     
  32. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    This means the CheckSphere is detecting a collider above the player (where they should lift the box to). Your character looks pretty big, so you would probably want to increase the "gap" on the Throwing script. Or do as the error suggests and make the player a separate layer and add a layer mask to the CheckSphere in the code itself.
     
  33. ZYSHAQ

    ZYSHAQ

    Joined:
    Jun 26, 2015
    Posts:
    48
    Hello,
    The monsters act perfectly on computer, but do not walk at all in the iPhone mobile version.
    They used to walk but they stopped... Any assistance?
     
  34. MrJump

    MrJump

    Joined:
    Feb 1, 2018
    Posts:
    2
    Hey Y'all,

    I'm having a Physics Material problem.
    I'm trying to make an Icy Platform for the Player to walk on but the problem is the player is not sliding.
    I set the Dynamic Static Bounciness friction to 0.
    Anyone out there got any solutions? thanks
     
  35. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,117
    You can simulate the ice effect switching the player mass to a bigger weight and using impulse forces to drive the character, the inertia will be bigger and movement control will be harder. If i got time i'll put some code.
     
    MrJump likes this.
  36. Intelligent_pie

    Intelligent_pie

    Joined:
    Feb 14, 2016
    Posts:
    93
    is this going to be updated again?
     
  37. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,117
    We can ask to the author.
     
  38. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    If I recall, this kit has never played well with physics materials. They work up until you actually move the character. As soon as you do, the friction levels are negated and the character moves like they normally would. I think you would need to lerp movement speed (where the rigidbody force gets applied in CharacterMotor) when on a slippery surface to simulate the effect.

    What were you hoping to see in an update?
     
  39. Intelligent_pie

    Intelligent_pie

    Joined:
    Feb 14, 2016
    Posts:
    93
    Ledge climbing, combo attacks, ranged weapons, combo jumps, more obstacles and enemy ai
     
  40. MrJump

    MrJump

    Joined:
    Feb 1, 2018
    Posts:
    2
    "Guten Tag",
    I recently posted a question about an ice platform thing.
    I kinda found a solution to the problem, I disabled the "Grab Box" and I made a platform with 2 box colliders, the first box collider is a trigger with the physics material "Ice" (which the Dynamic Static Bounciness friction is set to 0).

    The player slides around but the player animation just floats about and doesn't jump.
    Any solutions would be much appreciated.
     
  41. bonikill111

    bonikill111

    Joined:
    Jul 27, 2015
    Posts:
    7
    I found the best way to simulate movement on Ice was to use the grounded raycast check. Add a new tag for Ice and then just change the players mass, accel,and decel values when the grounded check returns that the player is on the Ice tagged object. Just don't forget to reset the values to default when the player is no longer on the ice.
     
    Last edited: Mar 22, 2018
  42. Intelligent_pie

    Intelligent_pie

    Joined:
    Feb 14, 2016
    Posts:
    93
    Where is the page with all the addons or is it spread all over this thread?
     
  43. GameIntern

    GameIntern

    Joined:
    Jul 25, 2012
    Posts:
    54