Hello everyone, so to keep it simple and short… I am trying to weld a pair of wings to the player’s back when the player presses ‘R’. I already have the R button press detection and remote event fire set up.
I have been searching on YouTube… on dev forum and following things what other scripters have tried to do, but all in vain. Please help if you can.
Here is the script:
local tweenService = game:GetService("TweenService")
local replicatedStorage = game:GetService("ReplicatedStorage")
local remote = replicatedStorage:WaitForChild("Remotes"):WaitForChild("WingActivation")
local resize = replicatedStorage:WaitForChild("Objects"):WaitForChild("Wings"):Clone()
local Goal = {}
Goal.Size = Vector3.new(1.798, 5.315, 1.641)
local tweenInfo = TweenInfo.new(3)
function Weld(weldMe, toThis)
local weld = Instance.new("Weld")
weld.Part0 = weldMe
weld.Part1 = toThis
weld.C0 = weldMe.CFrame
weld.C1 = toThis.CFrame
weld.Parent = toThis
end
remote.OnServerEvent:Connect(function(player, message)
local Character = player.Character
local Torso = Character:WaitForChild("Torso")
if message == "Equip" then
resize:SetPrimaryPartCFrame(Torso.CFrame)
resize.Parent = workspace
Weld(resize.PrimaryPart, Torso)
elseif message == "Unequip" then
end
end)
Clone the wings in the OnServerEvent event (Currently you are cloning only 1 pair of wings in the script).Also use WeldConstraint to anchor them both so they don’t fall.
function Weld(weldMe, toThis)
print("Welding Debug Print")
local weld = Instance.new("WeldConstraint")
weld.Part0 = weldMe
weld.Part1 = toThis
weld.Parent = toThis
end
And if that doesn’t work either, try switching around the Part0, Part1, and Parent? And as @HighFoxyplayz11 mentioned, clone the wings in the OnServerEvent, not outside of it, as it’s only making a single clone
For wings, you can put it in workspace, and pre-set a Motor6D or something different. I’d recommend using Moon Animator to do that though. And then put it back in Objects.
How to do this?
You should have a PrimaryPart, and a Character Rig.
You select the Character Rig’s HumanoidRootPart first, and then the PrimaryPart second,
then Weld in place with Moon Animator.
Here’s how it would work.
The next time you clone it, take the Weld object, and replace it’s C0 with the character’s HumanoidRootPart, and then you’re done.
@EmbatTheHybrid, he might also need them to be able to be rotated. So he might need to use a weld. I don’t know if you can rotate an object with Orientation and have a Weld or WeldConstraint at the same time.
Ok so I did what you said about cloning the wings in the OnServerEvent, and I also added a weldconstraint to both of the wings. They still manage to fall.
local tweenService = game:GetService("TweenService")
local replicatedStorage = game:GetService("ReplicatedStorage")
local remote = replicatedStorage:WaitForChild("Remotes"):WaitForChild("WingActivation")
local Goal = {}
Goal.Size = Vector3.new(1.798, 5.315, 1.641)
local tweenInfo = TweenInfo.new(3)
function Weld(weldMe, toThis)
local weld = Instance.new("Weld")
weld.Part0 = weldMe
weld.Part1 = toThis
weld.C0 = weldMe.CFrame
weld.C1 = toThis.CFrame
weld.Parent = toThis
end
remote.OnServerEvent:Connect(function(player, message)
local Character = player.Character
local Torso = Character:WaitForChild("Torso")
if message == "Equip" then
local resize = replicatedStorage:WaitForChild("Objects"):WaitForChild("Wings"):Clone() -- This will clone the wings everytime you call this event
resize:SetPrimaryPartCFrame(Torso.CFrame)
resize.Parent = workspace
Weld(resize.PrimaryPart, Torso)
elseif message == "Unequip" then
end
end)
Is this mesh made in an external program or found in the meshes section of the toolbox, or was it made with parts? If it was one of the first two methods it’s hitbox could be messed up, if there is any.
Here are some possible fixes if the hitbox is incorrect.
Hey guys, with the help of a friend, I found a solution, thanks to @PriestOfCheems, he told me to use a weld plugin and weld the parts in the model together and the way I had it before, which was through a WeldConstraint was incorrect.