Motor6d animation trouble

Trying to attach animations to a character riding a skateboard that will play a riding animation while nothing is being pressed, a pushing animation when moving forward and tricks when a button is pressed with the space bar.

However the animations that I have created appear different to how they were in the animation editor, I’m not sure if its something in the server script that is effecting this or something to do with the animations but here is how its supposed to look

vs how it ends up looking

and here is the server script


game.Players.PlayerAdded:Connect(function(player)
	
	game.Workspace:WaitForChild(player.Name)
	game.Workspace[player.Name]:WaitForChild("HumanoidRootPart")
	
	
	local skateboard = game.ServerStorage.GameObjects.Skateboard:Clone()
	skateboard.CFrame = (player.Character.HumanoidRootPart.CFrame - Vector3.new(0, 0, 0)) 
	skateboard.Parent = player.Character
	
	
	local hitbox = Instance.new("Part", player.Character)
	hitbox.Size = Vector3.new(4, 4, 4)
	hitbox.Shape = "Ball"
	hitbox.CanCollide = false
	hitbox.Transparency = 1
	hitbox.CFrame = player.Character.HumanoidRootPart.CFrame
	
	
	local weld = Instance.new("WeldConstraint", hitbox)
	weld.Part0 = hitbox
	weld.Part1 = player.Character.HumanoidRootPart
	

	local motor6d = Instance.new("Motor6D", skateboard)
	motor6d.Parent = player.Character.HumanoidRootPart
	motor6d.Name = "SkateboardMotor6D"
	motor6d.Part0 = player.Character.HumanoidRootPart
	motor6d.Part1 = skateboard


	local bodyVelo = Instance.new("BodyVelocity", player.Character.HumanoidRootPart)
	bodyVelo.MaxForce = Vector3.new(100000000000, 0, 100000000000)
	bodyVelo.P = 5000
	
	
	local velocity = Instance.new("NumberValue", player)
	velocity.Name = "Velocity"
	
	
	local canChange = true
	hitbox.Touched:Connect(function(part)
		if not part:IsDescendantOf(game.Workspace.Surfaces) and not part:IsDescendantOf(game.Workspace:WaitForChild(player.Name)) then
			game:GetService("TweenService"):Create(velocity, TweenInfo.new(0.001), {Value = 0 - velocity.Value}):Play()
		end
	end)
	
	
	velocity.Changed:Connect(function()
		if canChange == true then
			if velocity.Value > 40 then
				canChange = false
				game:GetService("TweenService"):Create(velocity, TweenInfo.new(0.001), {Value = 40}):Play()
				wait(0.1)
				canChange = true
			end
			bodyVelo.Velocity = player.Character.HumanoidRootPart.CFrame.LookVector * velocity.Value
			game:GetService("TweenService"):Create(velocity, TweenInfo.new(velocity.Value / 2, Enum.EasingStyle.Linear), {Value = 0}):Play()
		end
	end)
end)

Any help is much appreciated

1 Like

My only idea is overridng the default player walking and jumping animations. Maybe they are interfering in some way?

What is happening is that in the animation, the dummy is stationary, meaning they do not jump physically, only with an animation. When you jump, you physically jump + jump with the animation, resulting in double the height.

To fix this, all you have to do is animate the dummy and making it move as if it’s jumping without changing their Y-value.

I tried this and it did work somewhat, however because the board needs to pop up above the ground a little bit regardless it will still end up off the ground even a tiny bit and as a result the players feet still end up coming off the board

also the animation ends up losing a bit of its emotion as a result

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.