I got this so far but it doesn’t seem to work. The problem I am having is finding a way to rotate the tool itself. The tool is in workspace.
broom:WaitForChild('Handle').CFrame = CFrame.Angles(math.pi * -0.5, 0, 0)```
I got this so far but it doesn’t seem to work. The problem I am having is finding a way to rotate the tool itself. The tool is in workspace.
broom:WaitForChild('Handle').CFrame = CFrame.Angles(math.pi * -0.5, 0, 0)```
It’s almost right)
broom:WaitForChild('Handle').CFrame = CFrame.Angles(math.pi * -0.5, 0, 0)```
broom:WaitForChild('Handle').CFrame *= CFrame.Angles(math.pi * -0.5, 0, 0)
Just use this, you set CFrame AT ANGLE! Not move on 90 degrees!
Use should multiply your CFrame
I would recommend rotating the grip, this would be better, because it may pivot around it’s own pivot and not the grips. Try this:
broom.Grip *= CFrame.Angles(math.pi * -0.5, 0, 0)
It doesn’t seem to be working correctly
These are the files
Original:
What I’m trying to get from the script:
@KurumiFT I don’t know why it just breaks the handle is an invisible part that welds them all together.
@Den_vers The grip doesn’t seem to change it
Were you holding the tool when it rotated?
I see what’s going on, though, try welding the key part using a WeldConstraint
, and then unanchoring it. Then rotate the base.
No, I wasn’t holding the tool. Wdym by key part. None of the parts are anchored.
Well, I’m assuming this is a key that you want to rotate when activated, so the simple solution is to weld the key to the part, if you don’t want to union it, and then rotate.
I’m sorry, I don’t understand what you mean by key. The handle has 3 WeldConstraints that weld the 2 parts and the union to the handle.
Based on the screenshots, I would say that your tool is anchored or there isn’t welds. Check anchored on ALL your tool’s parts and check welds
Pretty much what I’m saying is to weld everything together.
they aren’t anchored, all the parts and union are set to anchored right after the CFrame angle part.
unequipBroom.OnServerInvoke = function(player, broom)
local character = player.Character or player.CharacterAdded
local humanoid = character:FindFirstChild('Humanoid')
local unequipPrompt = broom.Head:WaitForChild('UnequipPrompt')
local equipPrompt = broom.Shaft:WaitForChild('EquipPrompt')
local ridePrompt = broom.Shaft:WaitForChild('RidePrompt')
broom.Owner.Value = player.Name
if humanoid then
broom.Parent = game:GetService('Workspace')
--broom:WaitForChild('Handle').CFrame *= CFrame.Angles(math.pi * -0.5, 0, 0)
broom.Grip *= CFrame.Angles(math.pi * 0.5, math.pi * 0.5, math.pi * 0.5)
for index, value in broom:GetChildren() do
if value:IsA('Part') or value:IsA('UnionOperation') then
value.Anchored = true
end
end
unequipPrompt.Enabled = false
equipPrompt.Enabled = true
ridePrompt.Enabled = true
end
end
Sir, you have to weld them together. That’s why they are splitting.
It is welded
Are the welds enabled? And are they set up properly?
Yes, for some reason, changing broom.Grip
breaks it.
It’s probably because you’re not holding the tool. Even the official linked sword uses this method by changing the grip when you lunge.
Perhaps. Does changing the CFrame of the handle change the position and angle of the entire tool/broom?
It depends if it’s welded or not, the handle is just where the player holds the tool.
Video without changing CFrame or grip (When I unequip the broom, that’s when I want to change the angle of the broom):
What I expect to happen when changing the angle of the broom:
Okay, now since you say it’s welded, can you show me your code?
broom.Grip *= CFrame.Angles(math.pi * -0.5, 0, 0) -- this is how it should look.