This part was more of a warning to fellow programmers that might want to edit this or make something similar, the main focus was on how you could go about improving the replication’s performance by “weeding out” unnecessary calls to the solving/footplanting methods. For instance, if you had a game with 30 people, calling the footplanting method could take anywhere between 0.0004 and 0.001 seconds, which is 2.4% to 6% of the amount of time between frames, which as you add more and more things to your game, could cause some problems. Raycasts are rather inexpensive in comparison, and using them for some sort of render priority system would greatly improve performance as the amount of people in-game increases.
I could make IK not be calculated if the character is outside the player’s view?
That could also work, just make sure to account for the possibility that something off screen (the humanoid center) still has a part visible on screen (for instance, a leg). This is just a matter of slightly increasing the boundary for what is considered “in the player’s view” , and shouldn’t be too much of a change.
I remember using something like this to check if something is on the players screen when I made a chunk-based rendering system before StreamingEnabled was really a thing:
if -camera.CFrame:PointToObjectSpace(POSITION VECTOR3).z > 0 then
-- visible on screen
end
Not sure if this is fully up to date nor fully accurate, since it’s a few years old.
That code doesn’t work, unfortunately. However, Roblox’s API allows you to detect with CurrentCamera
functions!
An update has been made to not render Motor6D changes of any of the following conditions are met:
- The distance between the camera and the root part is greater than 200 studs
- The root part position is NOT on the screen
- The UpperTorso isn’t rendered due to
StreamingEnabled
This is now used in No-Scope Sniping, a larger-scale game.
You can see the IK mechanics here.
Really amazing work!
I’ve been trying to achieve something like this myself, but as I’m no good mathematician I had to give up on it in the end.
Would you be able to create some sort of module out of this, where you can for instance specify a target object to rotate towards, and a limb (for instance your arm) that will be affected by the IK solving algorithm?
Potentially, although there are many resources on YouTube and the DevForum to do this already.
Hey, is there a way to temporarily disable or set character back to default T pose?
“if climbing” part doesn’t seem to work, at all.
Great module bdw.
You can modify the module/script to do that
Could you provide a video?
My bad, i thought that when climbing it should stop moving or at least force idle pose.
It works with non startercharacters right?
What do you mean by non starter ?
Yes, as long as it is R15.
Make sure, however, you keep a consistent height among all of the players or the calculations may be incorrect.
This is really dope. Is there a way I can make the idle stance not look like the character’s about to drop last week’s Taco Bell?
You can change the idle angle of the UpperLegs’ Hips.
Seems pretty neat! Wonder if I could try making it compatible with R6
Will be a long and time consuming task, but I guess that’s the fun in scripting
Pretty sure you gonna have to scrap 80% of entire script, beacus most of the code is positiong those three parts of each leg.
It depends which part you are using.
The procedural animation (aka “The Movement Animation”) will take much longer, because it is direct manipulation of R15/RThro joints.
However, the IK portion is very easy to apply anywhere else, as the algorithm (“FABRIK”) is universal.
Yeah about this, any simple word explanation on how you are doing the procedural part? this is the part where I’m at after doing my own IK FABRIK system
Especially this part of the code:
local up =rootvelm/16
local cycle =up*dt*cycleSpeed
right =(right+cycle)%tau
left =(left+cycle)%tau
TL;DR:
Are you moving the target point in a circle and adjusting the circle direction based on the characters walking direction and also the floor through raycasting basically?
Any help with the units of the cycle and what is “up”
Also it’s pretty mesmerizing, tracking the “footpos” of the right leg in the gif, hope it’ll help others visualize the proccess.
Forwards:
Sideways:
I guess you could imagine a circle that’s been truncated with modulus.
Without the modulus or whatever, you would see that red bar moving in a perfect unit.
By flattening it, we reproduce that footstep appearance.