CFrame issues with skill

Hey yall i haven’t been here in a while.

So earlier today i started to work on a “Rasenshuriken” script.

It was looking smooth until i started to apply the CFrames.
I looked over the code and i couldn’t see what i did wrong, yet it still wouldn’t work properly.


Rasenshuriken.OnServerEvent:Connect(function(Player, Val, Power)
	local Character = Player.Character
	local RightHand = Character:WaitForChild("RightHand")
	local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
	local Humanoid = Character:WaitForChild("Humanoid")
	local Folder = Instance.new("Folder")
	Folder.Name = Player.Name.." Attack's Folder"
	Folder.Parent = Character
	
	if Val == false then 
		HumanoidRootPart.Anchored = true
		Object.Parent = Folder
		local Part = Object.Part
		local MeshPart = Object.MeshPart 
		local Weld = FunctionHandler:Weld(Part, MeshPart) 
		Part.CFrame = RightHand.CFrame * CFrame.new(0, 5, 0)
		MeshPart.CFrame = Part.CFrame
		local Weld2 = FunctionHandler:Weld(RightHand, Part)
		
		
		
		
		
		--[[local PartSpin = coroutine.wrap(function()
			local Nick = 400
			
			repeat
				MeshPart.Rotation = Vector3.new( 0, Nick, 0) 
				wait(.01) 
				Nick += 3000
				
			until
			i == h
		end)]-]]
			
			
		
		
	else
		HumanoidRootPart.Anchored = false
		Debris:AddItem(Folder, 4)
	end
end)

https://gyazo.com/884715f953d7e3a2557dd55f22c648ab

Any help would be appreciated

I’m confused how to reply to this, no wonder why im the first person to respond after 7 hours

Thanks for bumping. Anyways this is the bit of code that is causing the problem and indeed it is the CFrame, specifically the weld.

Yeah the attack part is welded above relative to the top of the RightHand CFrame. Consequently, when the arm animation plays and the arm points up the part will also go to where the part’s new UpVector is which is pointing towards the floor.

I believe it’s a better idea to weld it with the humanoid root part as the HumanoidRootPart is guaranteed to not move along with the animations since it is well the root part.

Otherwise you can manually position the part every renderstep/frame to the world position of an attachment in the HumanoidRootPart to prevent physics issues that might occur with the weld if you are going for a physics based attack.