does it get messed up because of the script? Or is it an animation or weight painting problem?
not entirely sure it the arm moves a bit when you adjust the tool it wasn’t doing this before im guessing if i animate it it might fix it all I know is that the model itself isnt like that
Well, the script is doing nothing to change the bone CFrames so ya it might help to animate your character, also if you made your character in blender make sure the weight painting isn’t wacky
Alright thanks for your help have a good day
So the right hand bone is snapping over to the hrp and since its in the center the arm bends over there and im not sure how to get the righthand part to be on the right hand
Tool Holding Followup
In my previous post, the script in it was a local script run from the client that altered motor6ds which unfortunately do not replicate from client to server or server to client. So if you used that script and looked at the server, the righthand part would be have the same CFrame as the hrp.
We can make the changes appear on all the clients and the server by doing the following:
if you haven’t already do the instructions in the first post, also here
previous post
Create a part,name it “RightHand”, make it’s size small(like (.1,.1,.1), make it transparent, make sure Anchored is off , parent it to your character model
Create a motor6D under the part you just made, make part0 your HumanoidRootPart and part1 is your RightHand(the part you just made)
Create a local script under StarterPlayerScripts and put this in there:
local LocalPlayer = game.Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local hrp = Character:WaitForChild("HumanoidRootPart")
local RunService = game:GetService("RunService")
local boneparent = hrp--or the parent of your bones
local bone = boneparent:FindFirstChild(yourhandbone, true)--or the bone that you want it to track
local mesh = Character:FindFirstChild(yourskinnedmesh)
local handToPartCenter = CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))+Vector3.new(0,0,0) --tweak until it looks good
RunService.Stepped:Connect(function(time, step)
if Character then
local partCFrame = bone.TransformedWorldCFrame * handToPartCenter
Character.RightHand.Motor6D.Transform = (mesh.CFrame:Inverse() * partCFrame)
end
end)
here is what is an example of what it should look like
the bone in the example is RightHand because there is a bone named RightHand that is a descendant of the hrp because thats what the bones are parented to in this character.
once you have done this then you can now make it appear everywhere
part two
first off, you need to make a weld, set part0 to the hrp and part1 to the part RightHand, and parent it to the part RightHand
optional-I name the weld “MotorWeld” if you don’t, just change it in the script
now we need to make a normal script under StarterCharacterScripts –make sure it is under StarterCharacterScripts and not StarterPlayerScripts because normal scripts won’t run under StarterPlayerScripts–
then put this in the script:
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(yourmesh)--the name of the charactermesh that you are using
local bone = boneparent:FindFirstChild(bone, true)--the name of the bone you want to track
local handToPartCenter = CFrame.Angles(0, math.rad(0), math.rad(0)) + Vector3.new(0, 0, 0)--use trial and error to tweak these values SHOULD BE THE SAME AS IN YOUR LOCAL SCRIPT
Character.RightHand.MotorWeld.C1 = CFrame.new()
Character.RightHand.Motor6D.Enabled = false
RunService.Stepped:Connect(function(tim, 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 = Character.RightHand.MotorWeld.Part0.CFrame:ToWorldSpace(Character.RightHand.MotorWeld.C1)
Character.RightHand.MotorWeld.C0 = C1:Inverse() * partCFrame2
end
end)
here is an example of what it should look like
i think thats it,
it should work(maybe)
If i messed up somewhere just reply and say where
it works but now my players righthand goes up into its self and just stays in the position even when i animated it to move the arm it will stay near the middle of the arm
This should be fun! Loading my first skinned mesh… Take 1!
Notes:
- All parts except eyes seem to be present and in the correct spot. Probably human error.
- Missing textures, but I’ve seen that before. Looks like I can fix that manually.
- Animations? Easy enough to find. No idea how to split them up. I know the frames, not the seconds. Otherwise, looks to be mostly correct.
- RightHand broken (RightHand is a block I added and rigged in hopes of dealing with the tool issues I have been reading about here. Kind of a last minute, ad-hoc choice, not surprised it failed first attempt.)
- Scaling slightly off. I can fix this!
All in all, not a bad first attempt!
robloxapp-20210607-1337419.wmv (1.4 MB)
Yes, this is a known issue we are investigating. Thanks for your patience.
Thanks for reporting this, we are investigating.
Sorry for the inconvenience, we are working on the importer, and we hope to make this process simpler in the future.
Please bear with me because I won’t have be able to get on a pc for the next week
So the problems with scaling and textures you can fix by importing the fbx the right way, which is:
If you are using blender, make sure the scaling is .01 instead of 1
Also when you are in the export menu at the top turn the path mode(that might be the right word?) To copy and click the little folder icon right next to it
Also I heard something about the uniform value messing up the export, I didn’t change it and haven’t had that issue because of it.
So exporting animations is sometimes tricky, I used a time intense and inconsistent method of exporting animations and it worked but @GolgiToad provided a better method so I deleted the old one. mixamo which is an online tool that will also work.
Ez method
doing this in a copy of your file is recommend
Find the animation that you want to export and put “aa” at the beginning of the name, after you have exported it as an fbx, rename the file to what it was before and repeat.
I use the export options of the normal(including bake animation) without start-end keyframes, leaf bones thingies. Then the nla strips were varying, sometimes I needed them on and sometimes I needed them off, if your animation does not import correctly try toggling the opposite of the value you had for nla strips. That should be it
Import your fbx animations into roblox animation editor and name them accordingly, once you are happy with them, publish them to roblox.
I use the default animation local script that you can get by clicking play in studio(without a StarterCharacter) going into your explorer, find the animate script under your character copying it, clicking stop, and pasting it into imported character. Then go into the children of the script and delete all the animations that you don’t have for your custom character(you may have to modify them in your script where there is a tap each of all the animation values if this method doesn’t work) and pasting all the animation numbers into the animation under the values
That should work, expect if you are having issues with the walk animation not being what it is supposed to be, it is because the animate script is trying to mesh your wall and run animations together which you can prevent it from doing that by deleting a certain line in the script that is in a function that is called something about running which calls a function which is called something with speed, if someone can paste the first 600 lines of the script here that would be great so that I can tell y’all which line it is.
And RightHand, I would suggest using the method that I recently posted, but if none of the bones are in the right place, you can add a bone in blender, add it to your animations and track that bone with a script posted earlier.
Some notes on attaching tools…
Just to clarify, if you are using an S15 rig, you should be able to attach tools just as for the R15.
That is, you can make a rigid Part and attach it with Welds or Hinges etc.
You can also make the tool mesh with joints in the authoring tool (ie. make the tool a skinned mesh), in which case when joined on to the character the skinning will put the mesh on top of the R15/S15 rig.
If you have an S1 rig - made of a single MeshPart but many Bone Instances - you currently need to make the tool a skinned mesh. Or use the lua script mentioned above.
However, very soon you will be able to attach MeshParts to Bones, as below:
If you are feeling adventurous you can try this now by turning on FFlagSimConstraintsWorkWithBones.
Thanks for your tips. I’m working through the bugs, one at a time, just as a learning exercise.
Specific to your advice:
I tried copying textures with your method, instructions seemed to be correct, but the result was a hot mess. I’ll put this aside, as I do everything with SurfaceAppearance anyway.
I have my own scaling, I just forgot to do it.
My animations are fine, but there’s something off about that “RightHand” meshpart. I deleted it, and everything works great. I just need to do some math to pull each animation out of the file. Low priority since its not broken.
Thanks again!
Yea, using surface appearance is probably smarter, if you want your fbx texture to be good than you need to bake all of your images onto one image which i am not the best at but have figured out how to do.
They will be replicated right, and will they replicate from client to server or not?
I would need to have a file of your skinned mesh and play around with it, but I can’t because I won’t be able to get on a pc for the next week