[OLD] SmartBone - An optimized module for Dynamically Simulated Bones

Crazy how they took it down just because some bad people used it for unintended purposes.

5 Likes

Does someone have a .rbxm file of this? I dont understand how to setup it up from the github…

To set it up from the github you have to do it this way:

Go here:

Copy the code of everything thats inside:

If you dont know how to copy it open the file and then click “Copy raw file”:

And you have to set it up like this in studio:
image

12 Likes

Thanks man, really helped me out there :pray:

1 Like

Am i right that the localscript should be in replicatedfirst and the rest in replicatedStorage? Im having some issues right now so i hope someone can help

No, the local script SmartBoneRuntime goes into StarterPlayerScripts

yeah i have one but u dunno if i am allowed to put it in the market whithout the consent of the creator

Is the github version the same as the one in the market? because it seems the github one was outdated and the market one is deleted for some reason :confused:

3 Likes

How would I be able to use this on an actual Rig?, Like an R15 Rig


heres an example of mine the main rig is invisible so the fake one can be ragdolled while keeping robloxs regular physics

Has anyone added the body-collision feature in a performant way? I’ve been asking if op would make that an update to the module but they have ignored it several times.

as a workaround to integrate collissions, you can make multiple parts sized (0.1, 0.1, 0.1) and place them at each bone’s position, whilst constantly updating their position to match the bone positions. Make sure they are massless. This is kinda lazy but after a little research this is the best method I could find :person_shrugging:

you could weld constraint them + update their position right

As far as I know I dont think you can weld parts onto bones (please fact check that, im not certain)
heres some code that might help you:

do note I have not tested it, however it should provide a general idea of how to implement something like this.

local rig = workspace.Rig -- your rig
local colliders = {};

-- We will use a dictionary which uses the bone as a key and the part as a value
-- such that we can then iterate over that dictionary and update the positions.

-- (colliders are the parts which have the same position as the bones)
-- Create the dictionary of bones and their corresponding colliders.

for _, v in ipairs(rig:GetDescendants()) do 
    if v:IsA("Bone") then
        
        local part = Instance.new("Part")
        part.Position = v.WorldPosition
        part.Massless = true -- if it has mass its gonna be janky kinda
        part.Size = Vector3.new(0.1, 0.1, 0.1) ; part.CanCollide = true;
        colliders[v] = part; -- create the key, value pair.
        
    end
end

-- Now we constantly iterate over that table and update the positions accordingly.
-- We use WorldPosition since Position is relative to the rig model.

game:GetService("RunService").Heartbeat:Connect(function()
   for bone, correspondingCollider in pairs(colliders) do
      correspondingCollider.Position = bone.WorldPosition -- update the position
   end
end)

1 Like

You can, just use an attachment and use the RigidConstraint instance
image

4 Likes

Does anyone know if the wind setting on this is reacting to the directional wind feature in Roblox Studio or is it not related to that?

Oh, thank you. I did not know about this!

1 Like

EDIT: Fixed with Seiiyo’s reply (you are a blessing!)

I’ve been getting this error often, and I’m worried about it. Is there any fix?


“ReplicatedStorage.SmartBone.Dependencies.Utilities:45:attempt to perform arithmetic(sub on fuction and number.”

line 45 is
until parent:FindFirstChildOfClass(className) or os.clock - start > timeOut

function module.WaitForChildOfClass(parent: Instance, className: string, timeOut: number)
	local start = os.clock()
	timeOut = timeOut or 10
	repeat 
		task.wait()
	until parent:FindFirstChildOfClass(className) or os.clock - start > timeOut
	return parent:FindFirstChildOfClass(className)
end

return module

I’m pretty sure you need to enclose os.clock with parenthesis os.clock().

os.clock is referencing the function and returns the function itself. Not the numerical value it should return. This is what it’s happening function - start instead of returnNumber - start you can see how well that went when the compiler yelled at you.

os.clock() invokes the function which we know returns a numerical value. You can also see the parenthesis being used in line 41.

local start = os.clock()

Referencing:

If you have any more questions, feel free to reach out. :slight_smile:

1 Like

Last I checked, No, it is not because the project has not been updated in quite some time.
You’ll have to connect and listen to the Workspace.GlobalWind property manually.

See this post. SmartBone - An optimized module for Dynamically Simulated Bones - #172 by Seiiyo

Do you have a .rbxl file of this working with the GlobalWind?

1 Like