Trying to rotate entire model

Hello all,
I’ve been trying to write a script where when you touch a part, it rotates your hand (The hand is a model made by me). So far I’ve tried using CFrame angels, but have had no luck doing so, have set the model PrimaryPart and tried rotating the model with the primary part, but had yet again no success. No errors, just nothing happening. The model is inside the character, so I use hit.Parent.GloveHandRight to make actions to the parts inside the hand etc. I would also union these, but am planning animations for the hands such as a fist, grip and idle animation. If anyone could give some advice on how to achieve this, it would be greatly appreciated.

The code for touch event:

	if hit.Parent:FindFirstChild('Humanoid') and debounce == false then
		debounce = true --Checking if part can clone again (no)
		local partClone = partThing:Clone() --Part clone
		local gloveR = hit.Parent.GloveHandRight --Gets right hand
		local HRP = hit.Parent.GloveHandRight.HandRootPart --Root part of hand
		--Checkpoint 1
		partClone.Name = partThing.Name .. "Cloned" --Setting Name
		print("Cloned " .. partClone.Name) --Letting me know the code worked
		--Setting Basics
		partClone.Parent = hit.Parent.GloveHandRight --Adding the part to hand
		partClone.CanCollide = false --Disabling CanCollied (let's you walk thorugh it)
		partClone.Anchored = false 
		--Creating weld
		local newWeld ="WeldConstraint", partClone) --Creates new weld
		newWeld.Part0 = hit.Parent.GloveHandRight.pickupPartCloned --Sets cloned part as main part
		newWeld.Part1 = HRP --Welds part to HRP
		--Rotates Hand
		gloveR.PrimaryPart = gloveR.HandRootPart
		--Resizng & Position
		partClone.Position = hit.Parent.GloveHandRight.HandRootPart.Position --Sets Position
		partClone.Size = partClone.Size/3

If anyone needs images of what the hands look like, or how the explorer is laid out, here you go:

Any help is highly appreciated, thanks!


I’ll take any help I can get, please. I’ve been working on this for 5 hours and need some help fixing it.

Well if there are no errors and nothings happening then the problem is that the code doesn’t run. The things that could cause this is that the event somehow doesn’t fire:

Or the if statement is false:

The fact that there is a print statement already in there with the cloned name tells me the if statement or event is not running at all so I would check there first I guess assuming the touch event is working in the first place. Otherwise, it is even possible the touch event cannot fire because it’s somehow physics less if a part is anchored or CFramed. Otherwise, is it a local script or server script? that might also contribute to if the script is not running in the first place as well.

1 Like