How would I rotate a tool by 90 degrees in x axis?

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)```
1 Like

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

2 Likes

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)
2 Likes

It doesn’t seem to be working correctly
These are the files
image
Original:
image
What I’m trying to get from the script:
image
@KurumiFT I don’t know why it just breaks the handle is an invisible part that welds them all together.
image
@Den_vers The grip doesn’t seem to change it
image

1 Like

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.

1 Like

No, I wasn’t holding the tool. Wdym by key part. None of the parts are anchored.

1 Like

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.

1 Like

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.
image

1 Like

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

1 Like

Pretty much what I’m saying is to weld everything together.

1 Like

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
1 Like

Sir, you have to weld them together. That’s why they are splitting.

1 Like

It is welded
image

1 Like

Are the welds enabled? And are they set up properly?

1 Like

Yes, for some reason, changing broom.Grip breaks it.
image

1 Like

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.

1 Like

Perhaps. Does changing the CFrame of the handle change the position and angle of the entire tool/broom?

1 Like

It depends if it’s welded or not, the handle is just where the player holds the tool.

1 Like

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:
image

2 Likes

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.
2 Likes