Positioning a Model correctly on the character, any help?

Thanks for responding. After testing, it actually did solve half of the issue, thanks! Now, My next issue is that I don’t know how i’d approach rotating / moving the weapons while keeping their position the same. my previous script did this but caused the issue above too so how would I approach this correctly?

As seen, the sword retains its correct position but in an undesired way

is the sword a model or a single mesh?

It is a single mesh, I should’ve clarified that, apologies, but it does have a few parts as children (the parts emitting particles) so i figured it also counts as a model
image
This is the Heirarchy

1 Like

alright!
i think using animations would work well.

just have 1 animation where the sword is is unequipped (presumably at the back), and 1 animation holding the sword.
to animate it, copy your character when the sword is unequipped (the sword attached the torso) and copy your character when the sword is equipped (the sword attached to the right arm).

make sure you set the animation priority to “action” or higher (i cant tell you enough how many times i’ve messed this up)

if you would prefair the sword to actually be rotated manually with code or have any issues, lemme know!

Thanks, I’ll try that. I would like to hear the manual method as well though so i can use the other if one method doesn’t work

sorry for the late response :sick:

rotating (and correctly positioning) the sword manually with code would be easiest to do with attachments.

you could make one attachment on the bottom of the right arm (since this is R6) for when the sword is equipped, and one at the back of the torso for when it is not.

i know you are using a custom rig, so adding the attachments is as simple as positioning and rotating the sword and then copy and pasting the position and orientation into an attachment parented to the arm/torso. (make sure you are copying into the WorldPosition and WorldOrientation properties and not the regular Position and Orientation properties.)

im not entirely sure how you are positioning the sword currently, but if you are still using welds, i think you can set the C1 (presuming the Part1 property of your weld is the sword) to the CFrame of the unequipped/equipped attachment.

to change the sword between being unequipped and equipped, you can use this:

local torsoAttach = char.Torso.SwordAttach --Used when unequipped
local handAttach = char.RightArm.SwordAttach --Used when equipped
--[[ Sword is Unequipped ]]--
SwordWeld.C1 = torsoAttach.CFrame
--[[ Sword is Equipped ]]--
SwordWeld.C1 = handAttach.CFrame

using animations would probably be overall better in this case, but either will probably work the same :coefficients:.

1 Like

No worries, Thanks for the reply

image
I am welding parts to different parts of the player then applying an offset to them so they are positioned where I want then setting the sword’s Position to those when needed, but I can just add attachments to these parts and have the sword act on those like you said. (these will be invisible when I’m done with them)

I’ll return after I implement what you have suggested and see how it goes, thanks!

1 Like

Apprently I can’t assign Attachments or their properties to welds (their Part0/1 proprery), they return with errors, according to the errors, welds can only attach to objects / baseparts

i see…
the fact that you have parts where you want the swords position makes it ALOT easier.
you could just set the SwordWeld C1 as the same as (for example the right arm’s part’s weld)'s C1 instead.

then you don’t need anything extra!
let me know if this works again, because im not entirely sure why it wouldn’t allow you to set the C1 of a weld to the CFrame of an attachment.
good luck!

SW.Parent = char
SW.Part0 = char.Torso:FindFirstChild("BackProxy")
SW.Part1 = Sword.SheathAttachment.CFrame
Sword.Position = char.Torso:FindFirstChild("BackProxy").Position
Sword.Orientation = char.Torso:FindFirstChild("BackProxy").Orientation
Sword.BlueGlow.Position = Sword.Position

did I do something wrong to cause this? this is the error that comes up when trying that

SW is the weld for reference

sorry, i probably should have been more precise

you want to set the C1 to the CFrame, not the Part1

again, i should have been more specific
my mistake!

Ah, where is this property? it’s not listed:
image

It doesn’t come up when typing it in code either

The method I find is the best for this is taking advantage of the player’s attachments. You can use the attachments on a player’s character to attach models to the character model, then welding each of model’s parts together and unanchoring them. For a better understanding I left this reply that best explains this concept:

1 Like

again, my mistake!
i didnt realise you were using weld constraints.
you need to use the actual weld instance instead :sick:

I forgot to mention that this can be applied to the character’s back and various other locations.

I’ll try this, thanks! just out of curiousity, can I make my own attachments also? If so, I can replace the proxies with Attachments instead since this seems to be more suitable for what i’m doing

I see, I was reading somewhere earlier that WeldConstraints were the “newer” alternative to welds, so I presumed they worked the same, what’s the differences other than what’s listed?

WeldConstraints are alot easier because all you need is 2 parts and that’s it, but with welds, you can set offset values, which would work better in this case.

good luck!

image
Got it working, thank you both!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.