Motor6D having untended effects with animations

  1. What do you want to achieve?
    I have an Idle and Use animation that is meant to be played when holding the item and using it.

  2. What is the issue?
    For some reason, the Motor6D code of the script doesn’t work, and made the animations come out like this:
    image
    This is the intended effect:
    image

  3. What solutions have you tried so far?
    I tried some solutions from the toolbox but that only made the problem worse like this:
    image
    I tried looking around the Dev Forum for some fixes for this but some of them didn’t work at all or were unrelated to this.

Here’s the code that I used for the “Script”, there’s no localscript.

--Varibles
local tool = script.Parent
local Player = tool.Parent.Parent
local Character = Player.Character
local Handle = tool:WaitForChild('Handle')
local debounce = true

local Particle = tool.heal:WaitForChild("Particle")

local Motor = Instance.new("Motor6D")
Motor.Part0 = Player.Character:WaitForChild("Right Arm")
Motor.Part1 = Handle
Motor.Name = tool.Name
Motor.Parent = Player.Character:WaitForChild("Right Arm")

local IdleAnimation = Instance.new("Animation")
IdleAnimation.AnimationId = "rbxassetid://13632867863"
local I = Character:WaitForChild("Humanoid"):WaitForChild("Animator"):LoadAnimation(IdleAnimation)

local AttackAnimation = Instance.new("Animation")
AttackAnimation.AnimationId = "rbxassetid://13633194461"
local A = Character:WaitForChild("Humanoid"):WaitForChild("Animator"):LoadAnimation(AttackAnimation)

--The actual Data

tool.Equipped:Connect(function()
	Particle.Enabled = false
	I:Play()
end)

tool.Unequipped:Connect(function()
	Particle.Enabled = false
	I:Stop()
	A:Stop()
end)

tool.Activated:Connect(function()
	local playergui = Player:FindFirstChild("PlayerGui")
	local humanoid = tool.Parent:FindFirstChild('Humanoid')
	if humanoid.Health >= 1*humanoid.MaxHealth then
		if debounce then
			debounce = false
			local Cooldown = 5
			game:GetService("ReplicatedStorage").RemoteEvent.Typewriter:FireClient(Player, {Text="I don't have to use this."})
			script.Parent.Cooldown:FireClient(Player, Cooldown)
			task.wait(5)
			debounce = true
		end
		return
	end
	if humanoid and debounce then
		debounce = false
		A:Play()
		Particle.Enabled = true
		local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
		Humanoid.WalkSpeed = 2
		Handle.Nobackpack:FireClient(Player)
		task.wait(2)
		Particle.Enabled = false
		Humanoid.WalkSpeed = 16
		humanoid.Health = humanoid.Health + 10
		local debuff = tool.Parent:FindFirstChild("STATUS_EFFECT")
		if debuff then
			debuff:Destroy()
			local shirt = tool.Parent.Torso:FindFirstChild("ScratchDecal")
			if shirt then
				shirt:Destroy()
			end
			local bleed = tool.Parent.Torso:FindFirstChild("ParticleAttachment")
			if bleed then
				bleed:Destroy()
			end
			local potiongui = playergui:FindFirstChild("PotionGui")
			if potiongui then
				potiongui:Destroy()
			end
		end
		Character.Humanoid:UnequipTools()
		tool:Destroy()
		--wait(4)
		--debounce = true
	end
end)
1 Like

Try changing the C0 or C1 position of the Motor6D like this:

Motor6D.C0.Position = -- Your position

Wait, how would I do it though? I don’t really know how to exactly do that.

I tried using Cframe.new and Vector3.new but it just says Position cannot be assigned to in “Output”. I’m a little new to scripting so I don’t know how’d I get my position.

Just click the Motor6D (in workspace) → Properties → C0 → Position → Change the stuff

How would I change it? While Playtesting? This Motor6D is an instance, I tried to change the orientation and position of the Motor6D while playing and it doesn’t do anything.

There’s 2 properties that you have the set (C0 and C1) in order for the Motor6D to work. Do this:

Motor6D.C0.Position = Vector3.new(idk, idk, idk)

Uh

Uh, could you send me a picture of the Motor6D in workspace (while testing)?

And it’s properties too.

Here:

image
image

Try this instead:

Motor6D.C0 = Motor6D.C0.Rotation + Vector3.new(idk, idk, idk)

Still ended up with this:
image

Maybe try this too (after the snippet of code I just provided):

Motor6D.C0.Orientation = Vector3.new(0, 90, 0)

Edit: I meant Orientation not Rotation

Did orientation and this:
image

Maybe also try this I guess:

Motor6D.C0= Motor6D.C0.Orientation + Vector3.new(0, 90, 0)

I keep accidentally typing Rotation for some reason.

Or you could try:

Motor6D.C0 *= Vector3.new(0, 90, 0)

image

Yeah i don’t really use Motor6Ds often or really anything related to Roblox’s ”physics objects”.

That’s probably why I keep getting things a but confused.

It’s ok, at least you tried to help! Hopefully I’ll get this fixed

Alright here’s a post I found to maybe help you:

Edit: best wishes!

1 Like