When I started making FBIK, I never even dreamed it could be used on 100 characters at the same time - after all, it is Full Body IK! So actually it was quite shocking to make that performance video.
Anyway, point being, normally in most cases you would need FBIK only on a couple of characters, the ones that are actually doing something that requires for it and that are close enough to the screen to even notice it. And of course you can smoothly blend out FBBIK for the characters in the distance or the ones who have been culled.
Can I ask, what kind of scenario do you have in mind, where youâd need 100 FBIK characters?
Here are the screenshots you asked for:
100 characters with the default normal FBBIK settings:
If you are getting the âFBIK Chain contains no nodesâ warning, you are probably adding the component without immediately calling SetReferences after. If you donât call SetReferences in the same frame, FBBIK component will try to initiate itâs solver and throwâs the warning if it has no bones to initiate.
So the IndexOutOfRangeExceptions happen, because you are trying to access the effectors of a solver that has not been initiated yet.
Thats probably because you have the GameObject you are adding it to selected. You see when the GameObject is selected, and you add the component somehow, the custom inspector for FBBIK getâs itâs OnEnable () call, sees that the character has no references, and auto-detects them. If the GameObject is not selected, there will be no OnEnable and the references remain undetected.
Would you mind creating a demo for the non programmer types out there that has a character following the mouse or an object in game mode? This is probably trivial for you guys but would be beneficial to the newbies like me. Perfect example scene would have something similar to this:
The dummy rigged up
Objects that you can click on and/or move in the game window that the dummy either reaches toward or otherwise reacts to
a gui button that toggles it to where the dummy reaches or looks/reacts towards where the mouse is
objects that are clickable that the dummy reaches towards or looks like he is going after
This would not have to be anything intricate just the very basics so that non-programmers can snatch the code and mutilate it to make it work for their needs
New tutorial up! This one is about the alternative uses of Aim IK. Iâm discovering that it is a very powerful component and the stuff you can do with it goes far beyond aiming weaponsâŚ
âŚAnd here is the code for this tutorial:
using RootMotion.FinalIK;
/// <summary>
/// Raycasting to the ground to redirect upper-body animation based on ground topography.
/// </summary>
public class TerrainOffset : MonoBehaviour {
public AimIK aimIK; // Reference to the AimIK component
public Vector3 raycastOffset = new Vector3(0f, 2f, 1.5f); // Offset from the character, in local space, to raycast from
public LayerMask raycastLayers; // The layers we want to raycast at
public float min = -2f, max = 2f; // Min and max for the offset
public float lerpSpeed = 10f; // The speed of lerping the IKPosition to make things nice and smooth
private RaycastHit hit;
private Vector3 offset;
void LateUpdate() {
// Find the raycastOffset in world space
Vector3 worldOffset = transform.rotation * raycastOffset;
// Find how much higher is the ground at worldOffset relative to the character position.
Vector3 realOffset = GetGroundHeightOffset(transform.position + worldOffset);
// Smoothly lerp the offset value so it would not jump on sudden raycast changes
offset = Vector3.Lerp(offset, realOffset, Time.deltaTime * lerpSpeed);
// The default offset point at the character's height
Vector3 zeroOffsetPosition = transform.position + new Vector3(worldOffset.x, 0f, worldOffset.z);
// Make the Aim Transform look at the default offset point (So when we are on planar ground there will be nothing for Aim IK to do)
aimIK.solver.transform.LookAt(zeroOffsetPosition);
// Make Aim IK bend the spine by the offset.
aimIK.solver.IKPosition = zeroOffsetPosition + offset;
}
private Vector3 GetGroundHeightOffset(Vector3 worldPosition) {
// Visualize the raycast
Debug.DrawRay(worldPosition, Vector3.down * raycastOffset.y * 2f, Color.green);
// Raycast to find how much higher is the ground at worldPosition relative to the character.
if (Physics.Raycast(worldPosition, Vector3.down, out hit, raycastOffset.y * 2f, raycastLayers)) {
return Mathf.Clamp(hit.point.y - transform.position.y, min, max) * Vector3.up;
}
// Raycast found nothing so return zero
return Vector3.zero;
}
}
I believe with Javascript you are supposed to maintain all the editor scripts inside an Editor folder that is not inside the Plugins folder. So if what you did was just moved the entire package to the Plugins folder, you should drag every script that is under Editor folder back out, make a folder Assets/RootMotion/FinalIK/Editor and put them there. I canât confirm on that at the moment, because I got to go, but you can quickly try this with just AimIKInspector and see if the error changes to another script. then youâll know it works. If it doesnât, let me know.
Sorry, I havenât touched Javascript for years now
you succeeded in what mecanim team failed to deliver
worth the price. good luck with the sales
customer request : integrate it with PlayMaker (add PlayMaker actions)
Ah, seconded. I completely forgot to ask for Playmaker Integration. Heck at this point I feel any and all significant Assets that have a even a modicum of complexity should support Playmaker. Itâs damn near a staple of Unity development!
Thanks for the feedback, guys . I will add Playmaker support. Itâs going to take some time though I havenât even tried that thing yetâŚ
Character System is also one of the things that Iâm planning to test Final IK with. Do you guys have any other 3rd party packages that youâre interested in?
First, thanks Partel for those awesome features, I was checking the assets store as often as possible to buy it first⌠but I had to update Unity xD
Iâve started to use the FBBIK component to fix an animation (riding a motorbike, hands and feet were not at the correct position, depending of the characters) and it was very easy to do with FinalIK, thanks again
But there are two things I tryed to do :
With FBBIK, there is a value âMaintain Rotation Weightâ for the head, I did not found how I can update this value in a script.
With LookAtIK, I did not found how I can update the position to look at in a script
Edit : I found the solution for the second question, it is similar to FBBIK :
I added this line :
public LookAtIK ikLootAt;
To update the position :
ikLootAt.solver.IKPosition = theLookAtPosition;
Save the script and grab the character on âikLookAtâ in the inspector
Edit 2 : About my first question âmaintain rotation weightâ for the head with a FBBIK, in script :
ik.solver.boneMappings[0].maintainRotationWeight = 0.5f;
ik is a public FullBodyBipedIK (public FullBodyBipedIK ik; )
I tryed with boneMapping[5] first, cause the head is the 6th element in the âMappingâ area in the inspector=> out of range
Then I tryed boneMapping[0] and it worked Youâre website is awesome as your package Partel ! Iâve found solutions in the class index pages.
Wow, Staff Pick and the reviews! That just made my day (and week and monthâŚ) Iâm humbled to the ground, that means a lot! Thanks You guys
@ Rohac
Thatâs because behind the scenes the FBBIK setup is much more complex than what you see in the inspector. I just wanted to keep the inspector as simple and visually clean as possible for ease of use. In the next version Iâve already added better shortcuts for the mapping, so you could use ik.solver.leftHandMapping and ik.solver.headMapping and so on.
IKPosition and IKPositionWeight is always a good place to start for looking, because they belong to IKSolver that is the base class for all IK solvers in Final IK.
I will improve the User Manual about the properties, perhaps add a âgetting started with scriptingâ section to each component. Thanks for the feedback!