To me, it seems like some of the problems you are having are server/client issues. Try seeing what it looks like on the server. Then you may be able to fix the torch particle problem.
For getting the left hand torch to work, I would suggest having it as a model. Then create a part that works as a hitbox(can collide off and transparency 1) that overlaps all of the parts in your model(weld it to the base part of the torch). Then create a clickdetector under your hitbox part. Create a part that works as a handle under your torch model and create a hinge constraint under the handle and set the part 0 to your handle and don’t set the part1 and turn enabled off(the handle should also be welded to your base part of the torch) .Put a normal script under your torch model and use something like
local model = script.parent
local handle = model.handle
local hitbox = model.hitbox
local fire = —wherever your fire is
local equipped = false
local player
hitbox.Touched:connect(function(part)
if part.parent:FindFirstChild(“humanoid”) and equipped== false then
local character = part.parent
model.parent = character
player = game.Players:getplayerfromcharacter(character)
equipped == true
handle.Hinge.Part1 = character.—put pathway to your lefthand bone here
handle.Hinge.C0 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0)—tweak this until
—play grip animation here
end
end)
Hitbox.clickdetector.Mouseclick:connect(function(clickplayer)
if player and clickplayer ~= player then—does not continue if the torch is being held and someone who is not holding it clicks it
return
end
fire.enabled = not fire.enabled
end)
that should be good. If you want to be able to unequip the tool then I can help with that, I was thinking of using coroutines to check if the model is parented to a character and binding a clickdetector to keyboard input to drop the torch(not sure if that works)
The point is not to be “realistic” the point is to have better looking player models and mesh distortion this allows devs to make custom characters without having to break them a part with ugly joints
Code is my weakness. This will take a few days to manipulate. I do see some elements I have already incorporated.
Adding this update:
Got Robie’s script to work! The flame follows the rigid part just fine, which means the ClickDetector should now work too. I don’t have anything left to do here but code it all together! WOO!
I could not locate this, so I applied for the Beta Program. I thought I already did, but I found no evidence of that lol. Kind of wandering around blind on this one!
Does it work on the server too?, if not check out my post “Tool Holding Followup” and change the bone to your lefthand bone. Also instead of changing the part RightHand’s CFrame, change it to I a part(I guess you would name it LeftHand and parent it under the character) then just script your fake tool so that it will weld to the part LeftHand on the touched event.
I will probably try to replicate what you are trying to do and include those scripts/techniques
I’m still getting used to the server side stuff. No, Robie’s code didn’t work over there, but your code was very similar to the original. I switched from a WeldConstraint to a Weld, and when in doubt, referred back to the working code from Robie.
You introduced a “Character.RightHand” when I think you just meant “mesh.” You already have the part positioned, welded, with a Motor6D in place. These edits work on client and server. Thanks again for all your help!:
local Character = script.Parent
local hrp = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")
local RunService = game:GetService("RunService")
local boneparent = hrp--or whatever part of your character that your bones are parented to
local mesh = Character:FindFirstChild("FlamePart")--the name of the charactermesh that you are using
local meshweld = mesh:FindFirstChild("FlameWeld")--the name of the weld between mesh and parent
local bone = boneparent:FindFirstChild("LeftHand", true)--the name of the bone you want to track
local handToPartCenter = CFrame.Angles(0, math.rad(0), math.rad(-90)) + Vector3.new(2.5, 0.5, -0.25) --adjust to align mesh with rig
meshweld.C1 = CFrame.new()
mesh.Motor6D.Enabled = false
RunService.Stepped:Connect(function(time, step)--if something errors in here make sure it is the right pathway to that instance
if Character and Character.Humanoid.Health > 0 then
local partCFrame2 = bone.TransformedWorldCFrame * handToPartCenter
local C1 = meshweld.Part0.CFrame:ToWorldSpace(meshweld.C1)
meshweld.C0 = C1:Inverse() * partCFrame2
end
end)
Ya, the purpose of the “Character.RightHand” was to make it compatible with tools. This is what roblox does with tools: When a tool is picked up, (whatever built in roblox script) search’s for two things, a part named “Handle” which is a descendant of the tool and a Part name “RightHand”, which is parented to the character. If both of those parts exist, then the roblox script is will create a weld under the the part RightHand, name it “RightGrip” set Part0 to the part RightHand and part1 to the part Handle. But all of this won’t happen if the part RightHand is does not exist or is not named correctly.
To any people who have actually looked inside roblox, I’m sorry if I was a bit wrong, this is just my best guess
Personally, I would make a part named LeftHand under the character and track that using a script, that way, I can just the same script in all of my fake LeftHanded tools so I don’t have to modify every single one
Ahh, I see. That’s the difference. I want to keep the freedom of the skinned mesh, and track what happens differently for each tool. For example, a whip or torch I might track just the end, where a sword or shield I would track the whole part. I plan on changing the animation up each time. Might be a problem later…
It’s exciting to see all the amazing skinning work in progress on this thread, nice job everyone!
Today, Roblox will be enabling a new internal code path relating to skinned MeshParts. This change lays the groundwork for some exciting developer facing features coming soon, but in itself should be unnoticed. That said, there is one known issue that we are hoping won’t impact many developers: if you have added joints to your skeleton hierarchy in Studio, that didn’t exist in your FBX import, they may not deform correctly. If your Studio skeleton hierarchy matches your FBX import, you should be unaffected. We have a fix for this in progress, but we want to enable this new code path without it, so we can stress test it as much as possible and get the new features to you as soon as possible.
If you are adversely impacted by this change, or if you notice any other regressions, please let us know, and we will work with you to resolve any issues asap. Thanks for your support and patience, we couldn’t do this without you!
Is there any possibility of adding support for bulk-setting the positions of Bone objects? An issue with my ocean code stems from how I simply cannot update many bones in bulk due to them being somewhat expensive - I have implemented a lot of code such as frustum culling just to try and mitigate the issue by as much as possible, but I believe a bulk-position setter would be the most optimal approach at the end of the day.
Could you apply the bone animations in chunks and only enable the animations for chunks within a certain distance of the character, doing this locally might increase performance too.
If you are using offset than you could create a algorithm to determine the offset of a bone(bone.transform) and apply them locally with in a range of the character, you could also use these values to calculate physics of the height of waves, so a part could float on top of a wave.you might want to do this with a module script so that the module script could take in other info like if there is a storm or not(waves get taller) or if there is no wind(waves are very flat)
I know very little about actors, but to my knowledge they might help
I’ve already done more than enough on my end. Setting a bone’s position takes 85% of the total update time alone - and I perform a whole summed gerstner wave algorithm per every bone, so you can see how it’s quite expensive.
It updates at 2ms. The issue is that I need to limit how much I can update - I can’t make the waves more detailed (more bones per square stud), and have to resort to spreading out the bones over a bigger grid, like tyridge does in his video.
We would like to optimize this eventually. Is there a way you can get the same effect using animations? That would be the fastest way to do it for now.
Sadly no, as it would ultimately be much less dynamic - I customize ocean settings where for instance the shore has calm waves, whilst the ocean has dangerous storms with huge waves. Animations would be not only extremely hard to use, but you’d have to remake them every time we would want to decide to fine tune them.
Basically, instead of updating every frame, I divide all the bones into tables that get smoothly interpolated over a few frames. This way the work that has to be done is nicely divided. Instead of having to compute 4000 positions at once, it now is reduced to 400 for example.
I found TweenService to be really slow and buggy, so I created my own (simple) interpolation module.
The code for my waves can be found here: https://github.com/noah-peeters/Roblox-Procedural-Ocean (the interpolation module is here: src/shared/WaveHandler/InterpolateVector3)
Having an option similar to BulkMoveTo would be extremely handy though. As it would improve every bulk bone movement.
Like others, when I edit my character which is a skinned mesh - it uses Dogu15 - it flickers all the limbs. This needs a fix soon as it’s making games that used skinned mesh rigs look worse.