fBasic Assets - Free collection of handy scripts

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 <

2 Likes

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.

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 :wink:

1 Like

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
2 Likes

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.

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

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.

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.

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?

1 Like

Thanks for the info! I will check it all and try to submit new version tomorrow.

1 Like

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

2 Likes

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!

*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.
4859129--467741--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?

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.

Ok for now I will use the Basic_Movement scripts and see where I go from there.

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?

4866851–468860–Walk on Walls.zip (1.65 MB)

You can try replacing code inside FBasic_RigidbodyMovement, method OnCollisionStay() to this

        private void OnCollisionStay(Collision collision)
        {
            if (jumpCollisionFrameOffset)
            {
                jumpCollisionFrameOffset = false; return;
            }

            float dotPrecision = 0.75f; // Smaller number -> Character can ride on bigger slopes

            // Check if we collide with something under our legs
            for (int i = 0; i < collision.contacts.Length; i++)
            {
                if (Vector3.Dot(collision.contacts[i].normal, Vector3.up) > dotPrecision)
                {
                    Grounded = true;
                    Jumped = false;
                    break;
                }
            }

            CheckIfFacingWall(collision);
        }
1 Like

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.

Hi. First-of-all, thanks for the great asset! I’m still looking through all the scripts. While testing FBasic_AddPhysicalImpact, I noticed it throws the “Input force is { NaN, NaN, NaN }” error if you leave RandomDirMultiplier at zero. It can be fixed by replacing randomImpact /= sum; with if (sum != 0f) randomImpact /= sum;
Is there a reason why you don’t make the asset available on GitHub? I’m sure there would be a lot of pull requests, and you wouldn’t have to sort out the issues yourself.

Should your latest version 1.2.6, work with 2020lts?
Seems to give out lots of errors even when imported to a new project?
Any hints?