Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

fBasic Assets - Free collection of handy scripts

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

  1. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    fBasic Assets is package with helpful scripts which can be useful for tests in your project, or you can extend scripts to your likes, they're commented in detailed way.

    PACKAGE IS FREE

    Package contains among others:
    - Character movement implementation featuring separate CharacterController and Rigidbody implementation
    - Basic TPP camera controller with some extra parameters
    - Free Camera controller with smooth motion settings
    - Auto generating interaction area component with examples of knob and lever
    - Vector, Ease, Logic and other helper classes with useful static methods
    - Simple behaviours like rotator, projectile, spinner, material offset and others
    - Behaviours simulating vibration, fly, power up movement
    - Generic class for choosing elements form list without repetition
    - And others!

    Package will be constatly updated with some new scripts as I create new packages or games.

    > Check for Free on the Asset Store <

     
    Last edited: Jan 7, 2019
    Neviah likes this.
  2. javzero1

    javzero1

    Joined:
    Jan 4, 2017
    Posts:
    1
    HI ! where can I found some documentation about how to use this asset?

    I im triying to implement movement and camera on my character. (Humanoid and rigidbody).
    I manage to make my model move and set Inputs but I don´t know how to properly set my animations
    (I allready have an working animator, only need to send booleans, triggers and that stuff).
    Can you give me some tips ?

    By the way. Importing this asset in a HDRP proyect will missconfigure everything. Be carefull.

    This is the best character controller (With RB) that I found !!.
    I´m waiting to solve this to use your other assets!!

    Thanks
    Jav.
     
  3. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    It's free pakage so I didn't add documentation beacause it would be very big amount of stuff to describe, but I tried to make detailed comments in script files and example scene.

    If you need help how to set up the animations, you can check how it's done in "FBasic_FheelekController"
    it is derived class from 'FBasic_RigidbodyMovement' so FheelekControler does the same with some extras or overriding.
    Animation stuff is executed inside 'FBasic_FheelekAnimator' and FheelekController have this class as variable.
    You want to use animator's variables to trigger animations but I mostly using 'animator.CrossFadeInFixedTime'
    you can replace it.

    I think HDRP will missconfigure materials for almost all packages on the asset store, I would need to create another .unitypackage with hdrp shaders so someone can unpack it if using this render pipeline.

    Hope I helped a little but feel free to ask for more ;)
     
  4. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    Updated to version 1.2:
    - Added draggable physical objects scripts and example scene
    - Added some new handy scripts (path data, some editor help stuff)
    - Added "Phantom Refraction" shader
    - Added new models with animations, designed for tests
    - Polishes in some scripts
     
    StevenPicard likes this.
  5. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    382
    tried installing today's update but the scripts won't compile.

    Assets/FImpossible Games/FBasic Assets/Editor Tools/FPropDrawers_MinMaxSlider.cs(6,34): error CS0246: The type or namespace name `FPD_MinMaxSliderAttribute' could not be found. Are you missing an assembly reference?


    Assets/FImpossible Games/FBasic Assets/Editor Tools/FPropDrawers_MinMaxSlider.cs(13,13): error CS0246: The type or namespace name `FPD_MinMaxSliderAttribute' could not be found. Are you missing an assembly reference?

    after playing around I found if I move the 'FPD_MinMaxSliderAttribute.cs' file out of "Editor" folder and into "Editor Tools" folder, then it compiles.
     
  6. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    Yeah I changed names of about two scripts, unity packages aren't changing names of files if they already were in the project, the best way is to delete "fBasic Assets" folder and import all again
     
    Last edited: Apr 9, 2019
  7. Moggsy316

    Moggsy316

    Joined:
    Feb 17, 2019
    Posts:
    4
    First of all, I just wanted to say this is a fantastic asset.

    I just wanted to ask is there a way to utilise the draggable objects script to have a character drag a ragdoll character object, dragging it by the hand or leg for example?

    I've been trying to get this to work but have not been able to make it happen.
     
  8. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    Hi Moggsy and thank you.
    I'm sorry, I was reading this message few days ago and somehow forgot to reply.
    I didn't use this component in that way, if could you mail me package with setted up ragdoll I could try make it work, check what can be wrong with that.
     
  9. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    558
    Just to let you know it imports with errors in 2019.2 You'll need to change
    public class BackgroundColorAttribute : PropertyAttribute
    to
    public class NewBackgroundColorAttribute : PropertyAttribute
    to avoid some internal conflict. There are 3 Instances need to be changed in that script.

    If you use the other assets which use that script then you'll need to change that line of code each time you import. Right now Fbasic assets has it, tail and spine animator and look animator have it and probably others I haven't used.

    Also in the fbasic assets demo the 2 characters you can switch with no longer rotate anymore when you turn?
     
    Last edited: Aug 11, 2019
    FimpossibleGames likes this.
  10. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    Thanks for the info! I will check it all and try to submit new version tomorrow.
     
    SilverStorm likes this.
  11. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    Updated to version 1.2.5:
    - Added "FBasic_Conversation" system for basic dialogue logics
    - Added new features to "FAnimationClips" class
    - Added class "FBasics_PathData" full of handy methods to work on movement over simple paths
    - Upgraded few scripts

     
    ceebeee and SilverStorm like this.
  12. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    558
    I was very impressed with your character controllers terrain/mesh ability to walk on slopes. I am planning to study it for a platformer walking on curved mesh floors like this:

    I have had some issues with Character Controller so I might try Rigidbody we will see.

    At 51 seconds and for the next minute onward in the video you can see him walking up quite a bit of slopes so I'd like to create that it looks so fun!
     
  13. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    558
    *Pre P.S: Your dialogue system seems pretty cool haha.

    Hi there the demo scene SF_Basicdemo when you press E to switch characters are still bugged. The characters are static while you move around and don't rotate.

    Putting the character in a fresh scene results in the same issue-the character won't animate properly. Here's the Gif showing the issue, it also appears in the demo scenes. My only guess is their animator is not being initialized properly? I am not sure I don't use Mecanim in long time.
    FBasic Bug.gif

    Update the Fheelek Controller script works great on it's own. I am assuming now that you deliberately avoided adding animations to the Rigidbody and Character Controller examples because we would make our own right or are they just bugged? Regardless it would still be nice if we could get rotations working even if it's without animations in those examples.

    P.S: The Fheelek prefab is so nice btw, it's actually quite amazing how it handles slopes however the camera often suddenly jerks when there is a sudden small elevation step that might sometimes occur on terrain. How can we apply a smoother follow-maybe a delay or smoothed cinematic lock on the character instead of a immediate matching of the players Y position?
     
    Last edited: Aug 15, 2019
  14. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    They don't rotate on purpose, it's empty class for programming custom way of rotating object etc.
    FBasic_FheelekController shows how can you use FBasic_RigidbodyMovement using class parenting.

    You can change "Skin Height" variable to lower value, but for more smoothing it would need a bit more code (when stepping down). I am working on other package which will handle all this stuff smoothly.
     
  15. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    558
    Ok for now I will use the Basic_Movement scripts and see where I go from there.
     
    Last edited: Aug 15, 2019
  16. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    558
    I ended up going with my own camera solution which has a very smooth follow now and a bit of a delay with the controller. Right now however the character is walking on walls-I have attached the video, anyway to fix that without having to add too much code?
     

    Attached Files:

  17. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    150
    You can try replacing code inside FBasic_RigidbodyMovement, method OnCollisionStay() to this

    Code (CSharp):
    1.         private void OnCollisionStay(Collision collision)
    2.         {
    3.             if (jumpCollisionFrameOffset)
    4.             {
    5.                 jumpCollisionFrameOffset = false; return;
    6.             }
    7.  
    8.             float dotPrecision = 0.75f; // Smaller number -> Character can ride on bigger slopes
    9.  
    10.             // Check if we collide with something under our legs
    11.             for (int i = 0; i < collision.contacts.Length; i++)
    12.             {
    13.                 if (Vector3.Dot(collision.contacts[i].normal, Vector3.up) > dotPrecision)
    14.                 {
    15.                     Grounded = true;
    16.                     Jumped = false;
    17.                     break;
    18.                 }
    19.             }
    20.  
    21.             CheckIfFacingWall(collision);
    22.         }
     
    SilverStorm likes this.
  18. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    558
    That worked perfectly! Thanks so much.
    I will try to keep you updated as I shape this controller, I will need to make it's movement more precise especially when jumping since it feels a bit rigid and imprecise. I'll let you know how it goes next few days.