Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I make this part move but without it moving the player also?

Asked by
rennec 5
9 years ago

So, I've made a morph, and a simple C-Frame script in a GUI to rotate a part called "aura" repeatably, but it rotates the player with it. I'm guessing it's because it's welded to the player. How do I make it so only the part moves, not the player?

1
One solution would be to use a Motor6D and change the rotation of it's C0 or C1 property. It's what are used to weld your Characters arms on but still allow them to move. BlackJPI 2658 — 9y
0
Masta is right. Just use Motor6D to change the rotation to C1. GreekGodOfMLG 244 — 9y

1 answer

Log in to vote
0
Answered by 8 years ago

Here's what I recommend doing, and excuse me if I don't understand what you are trying to do and I got it wrong.

What you have to do to rotate a part in a morph is use a LocalScript (It has to be moved to the player's Backpack, so a "giver" in the morph button would be good for that) with a code somewhat like this.

local character = game:GetService("Players").LocalPlayer.Character
local morphbody = character:WaitForChild("Chest") --I ASSUME IT'S CHEST BECAUSE THAT IS A POPULAR MORPH SYSTEM. CHANGE THIS TO THE NAME OF THE MODEL BEING MORPHED WITH AURA IN IT

morphbody.aura:BreakJoints() --Break it off from the character so that it can move freely

game:GetService("RunService").RenderStepped:connect(function ()
    --This will require some work, you have to find out the CFrame from the character's torso to the "aura" part.
    morphbody.aura.CFrame = Torso.CFrame * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0) --Replace CFrame.new(0, 0, 0) with that CFrame from the torso, and the CFrame.Angles() to the GUI rotation value.
end)

If I goofed on the above please PM XanthicDragon

Ad

Answer this question