Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

【Ground Fitter (free)】- Fit your dynamic objects to ground

Discussion in 'Assets and Asset Store' started by FimpossibleCreations, Jul 20, 2018.

  1. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    You giving groundFitter quaternion y value (it's not degrees) you need put here euler degrees (this is viewed inside inspector window), so:
    Code (CSharp):
    1. fitter.RotationYAxis = lookCenter.rotation.eulerAngles.y;
     
    Last edited: Sep 18, 2019
  2. NerdIt-

    NerdIt-

    Joined:
    Oct 19, 2018
    Posts:
    24
    nvm. I found a solution. I just did this:
    Code (CSharp):
    1. fitter.RotationYAxis = lookCenter.rotation.y * 180;
    and it works fine. Don't know why it happens though.
     
  3. NerdIt-

    NerdIt-

    Joined:
    Oct 19, 2018
    Posts:
    24
    @FimpossibleGames You have been very helpful thx. Sorry that I am a noob at using these sorts of unity assets. I am just trying to get the actual fitting to work now. But like some others in this thread... it isn't working. I have read through some of the comments but I still can't find what is wrong. Here are my Ground Fitter settings:

    The plane I am testing the object on is slanted at 9 on the X-axis and is tagged as Ground. Is this correct or am I missing something?
     
  4. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    I don't think if I fully understand, but also plane shouldn't be tagged as Ground, it layer should be Ground.
     
  5. NerdIt-

    NerdIt-

    Joined:
    Oct 19, 2018
    Posts:
    24
    @FimpossibleGames
    Sorry, I meant layer not tagged. I just don't know how to get the actual fitter to work now. Absolutely nothing happens on the default settings and nothing happens on the settings that I copied from the example prefabs.
     
  6. NerdIt-

    NerdIt-

    Joined:
    Oct 19, 2018
    Posts:
    24
    The object just falls through the ground. even though it has a box collider
     
  7. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    Can you mail me scene with the problem? There can be many different cases for the issue.
     
  8. NerdIt-

    NerdIt-

    Joined:
    Oct 19, 2018
    Posts:
    24
  9. NerdIt-

    NerdIt-

    Joined:
    Oct 19, 2018
    Posts:
    24
    Just checked and the mesh for the Bear model I was using had disappeared. You need to reapply that. You will also have to reapply the Gravity script to the "@SceneManager" gameObject. That should be it.
     
  10. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    I don't know how movement of your characters will be calculated, but if you need ground fitter only to change rotation, untoggle first variable 'ChangePosition' then ground fitter will not try to glue object to the ground.
    Take a look on pink line in scene window, it's ray which will try to detect collision, your model origin center isn't foots so you can set 'RaycastHeightOffset' to zero, so ray will start from center of the model, then change 'RaycastCheckRange' to about 15 (ray will reach ground below feets of bear), because your model is very big. Then it works for me on the scene. (but bear was bouncing off the plane when I hitted play so I freezed rigidbody and moved bear over plane in scene window)
     
  11. NerdIt-

    NerdIt-

    Joined:
    Oct 19, 2018
    Posts:
    24
    It worked thx
     
  12. NerdIt-

    NerdIt-

    Joined:
    Oct 19, 2018
    Posts:
    24
    @FimpossibleGames Hi me again. Your asset worked for a bit (not accurately mind you, but that would have been my fault), but I recently watched your "Rigging a Dragon" video on youtube and tried to apply it to the bear (which I still haven't animated). It didn't work at all. I tried to follow as closely along as could with my smaller model, I ignored the animation bits just for now because I didn't animations set up yet.

    Whenever I approached a hill. The bear will automatically pull itself up to the top extremely fast and then would stick there like a magnet. How do I fix?
     
  13. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    I will send you full setup with explanation in PM soon
     
  14. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    would this work with a third person controller?
     
  15. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    Depends what you mean, there is example scene with tpp camera.
     
  16. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    i mean like can i just use the rotation without using to much of the provide movement (using the provided movement only allows my character to walk back and forwards but not sideways
     
  17. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    I also noticed by player carries on with the animation on slope areas :/
     
  18. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    I will send you soon version with possibility to move in any direction (it will be built in next ground fitter version) but I had a bit too much stuff to handle lately :(
     
  19. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    ah its okay hope you are okay :). i just need the rotation side of this asset to allow my player to walk down banks
     
  20. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    Sorry it took so long, I just added ground fitter 1.1.9 to review and should be soon on the store.
    I can't send you PM (you have limited profile) but you can send message to me if you want this version sooner ;)
     
  21. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    for some reason since the update my player wont tilt when going up and down a hill :(
     
  22. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    There was many script updates in newest version, some variables could be resetted, please check if ground layer mask is now correct for your project.


    V1.2.0 Changelog:
    - Reworked some scripts for cleaner view in code (parenting, smaller classes etc.)
    WARNING: Some variables can be resetted when you import this version
    - Upgraded precision of root motion rotation
    - Added new simplified component
    - Added scene which is using simplified component in use with Unity's CharacterController physical movement component and root motion

    * Changed variable names like:
    RotationYAxis to UpAxisRotation
    ChangePosition to GlueToGround
    YOffset to UpOffset
    delta to deltaTime
     
  23. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    check them at everything works as it should accept the tilting is no longer working
     
  24. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    My player keeps spinning back to to face its original starting position anyone know what could be causing this? also would this asset work with swimming (like a buoyancy)?
     
  25. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,620
    I tried having a snake move and fit to the ground. Which ones of your assets do I need to make this work? Or is that even possible at all? Currently the head is in the terrain, i guess because the pivot is in the center.

    s.jpg
    And is it possible to have a more natural input, i. e. pressing right should move the gameobject to it's right, not to the right side.

    Thanks for the help!
     
  26. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    You can use 'Zone Cast' to make ground detection longer for long creature like this
    (One of my tutorial with setting Zone Cast)
    but if you need all segments of snake fit to ground you would need Spine Animator
    (For Spine animator: If your snake bones structure goes straight from neck to tail end or in reversal, if your skeleton goes from center to neck and from center to tail end it will not work, also with spine animator pivot on head would help indeed, with just ground fitter it's better to keep it in center)

    Yes you can, you can do custom input script, but try pressing Q and E keys, it will move to sides.
     
    Rowlan likes this.
  27. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    whenever i open my project my player with the ground fitter movement wont move, i have to remove input and movement ground fitter then re-add them to get it working again any ideas what could be issue?
     
  28. mckelynn

    mckelynn

    Joined:
    Dec 20, 2018
    Posts:
    22
    Thanks so much for making this. I'm kinda a newbie, so I'm wondering - at 25 seconds in your promotional video (
    ) you can see the creature's tail going through the floor. Do you have recommendations for what would keep it above ground?
     
  29. FimpossibleCreations

    FimpossibleCreations

    Joined:
    Jun 27, 2018
    Posts:
    300
    When use Spine Animator tail would align to movement and not clip through floor but it's not free.
    Or use Tail Animator and apply collisions.
    Last thing you can do is rotating your tail bone (In LateUpdate() ) when creature object is rotated in x axis too much.
     
    Last edited: Apr 30, 2020
    mckelynn likes this.
unityunity