Also check if it is anchored or not.
Do accessories work for shoes or boots? I was wondering if I could do this for my Ice skating system. Thanks!
This will work for any limb that has attachments in them. When you use AddAccessory, the Humanoid will line up attachments between the accessoryâs handle and one of the same name within the rig, then weld the attachments together. I do recall there being attachments in leg limbs so absolutely it would.
How would you change the grip?
If you need to change the grip, you would need to change the properties of the accessory and then reattach it to the player. You may lose some of the instant offsetting magic that a Tool instance provides primarily because once you change values around, the joint between the attachments may break.
I wish I knew this method way before but Iâll keep it in mind for future use. Thanks for showing us this!
How would I do this with a tool/model consisting of multiple parts? Iâve tried things such as parenting the parts to the handle but only the handle is affected.
You will need to weld all extra parts to the handle. Parenting will only change where the part is located in the hierarchy but it doesnât have any implicit behaviours. You can find several resources, plugins and code samples to help you perform this. Studio also has a built-in welder via the constraints menu.
Hello! How would I go about moving the right arm using this implementation? What I mean is when you use a normal tool it automatically moves the arm up so I would like to copy this behaviour using this method. Do you do it with animations?
Yes, you would have to do this through an animation just like how itâs done for regular tools. The Animate script accounts for an equipped tool and then plays the generic tool idle animation: this behaviour will have to be modified, mimicked or done in another way.
I do not have an edit of the Animate script handy in this case. You can consider making use of BindableEvents and RemoteEvents to accomplish a mod similarly to how the Animate script checks for a tool before playing the hold animation.
Awesome! Never knew about this. Thanks colbert.
btw colbert can we do that with models?
If you were to put a model in an accessory, the requirements donât change. All that would happen is that your parts now belong to a model instance and are a generation down in the hierarchy. So long as you still have a handle outside the model and the parts are welded to it, youâre good.
If what you meant by âcan we do that with modelsâ as in foregoing an accessory and instead directly applying models to players, you can do that as well. Youâd virtually follow the same steps including adding attachments so itâs easier to position your models. Main difference is youâd have to handle the welding yourself. You can use the following code to do that:
local accessoryWeld = Instance.new("Weld")
accessoryWeld.Name = "AccessoryWeld"
accessoryWeld.Part0 = YOUR_ACCESSORY_HANDLE
accessoryWeld.Part1 = LIMB_TO_ATTACH_TO
accessoryWeld.C0 = accessoryWeld.Part0.ATTACHMENT_NAME.CFrame
accessoryWeld.C1 = accessoryWeld.Part1.ATTACHMENT_NAME.CFrame
accessoryWeld.Parent = accessoryWeld.Part0
Let me know if this explanation is too confusing, might be able to create a picture tutorial for that as well.
EDIT 12/03/2021: Use RigidConstraints to snap accessories together by their attachments instead.
that mean if in the model its still have a handle it will be good? and also does the model need to be setPrimaryPartCFrame also what is the best way to position it (when there are no model) because its kinda hard and poopey to position it also the explanation is somehow confusing and the model dont actually works (i used model because it has texture insibe so i couldnt union it)
Iâm not too sure I understand what youâre asking here or if there any inferences being made. To be clear: handles are just regular parts. Some objects on Roblox require this specially named part for various actions, but there doesnât always need to be a handle so long as youâre willing to do all the welding yourself (e.g. accessories, tools, so on).
No. Unanchor all the parts, weld them to a root (typically might be your PrimaryPart which is the Handle) and they will automatically have their positions updated when the root part moves.
Thatâs why the attachments exist. When you weld two attachments together, ideally they should line up, so the model is snapping at the position of the attachments. You can see in the picture tutorial I had up that the two attachments eventually connect, leading to being able to grip the tool the way the character does in the last screenshot.
In what way?
Which model and also in what way?
oh thx you for the explanation but i have manage to understand in a better way thx for the help i appreciate it btw the C0 and C1 is confusing
Honestly I still find C0 and C1 confusing myself. Theyâre meant to be offsets for Part0 and Part1 since not setting them will make the parts snap together in the middle. In this case, Iâm using both accessories to âoffsetâ the parts when they get attached to the player.
Itâs better to see how the parts behave when you actually start welding. An explanation really doesnât do those properties too much justice.
How can I change the position to where the knife is attached to the hand?
This has been asked and answered earlier: please do make sure to read through the replies to see if your questionâs been asked before!
This really helped me - just one problem. I applied this method to a click detector, and it works fine. But the only problem is that ALL players receive the model attached, and I only want it to attach to the local player. How would I go about doing this?