Animation being silly

Ok so I’m assuming this has to do with roblox itself and not the code considering that I dont modify the animation except for me playing it sooooo.

My problem is that um the animation is being a little weird um just watch the videos.



So does anyone know how to fix this?

2 Likes

im not able to watch the two videos but its probably your code based on what youve said lol

Oh well heres the code Ill fix the video in a sec:

module.abilites['DoubleJump'] = function(player:Player,jump)
	
	-- instances-------------------------------------------------------------
	
	
	-- player
	local char = player.Character

	-- instances
	local root = char.PrimaryPart
	local rootAttach = root:FindFirstChild('RootAttachment')
	local hum = char:FindFirstChildOfClass('Humanoid')
	local animator = require(hum:FindFirstChild('AnimationHandler'))
	
	print(animator.getAnims())
	local dbAnim:AnimationTrack = animator:GetAnimation('DB1') or animator.getAnims()['DB1'] -- get anim
	
	local foreceMulti = 1
	local downwardsForce = 1
	
	local forwardSpeed = -50
	
	if jump > 1  then
		foreceMulti = 1 + (jump / 2)
	end
	
	-- attachments
	local RLA
	local RLA2
	local LLA
	local LLA2

	if hum.RigType == Enum.HumanoidRigType.R15 then
		RLA = char:FindFirstChild('Left Foot'):FindFirstChild('RLA')
		LLA = char:FindFirstChild('Left Foot'):FindFirstChild('LLA')
	elseif hum.RigType == Enum.HumanoidRigType.R6 then
		RLA = char:FindFirstChild('Right Leg'):FindFirstChild('RLA')
		LLA = char:FindFirstChild('Left Leg'):FindFirstChild('LLA')
	end

	RLA2 = RLA.Parent:FindFirstChild('RLA2')
	LLA2 =  LLA.Parent:FindFirstChild('LLA2')
	
	-- set values of hum
	hum.WalkSpeed = 0

	-- double jump
	print(RLA,RLA2)
	EffectEvent:FireServer('Create','DBJTrail',trails:FindFirstChild('BlueElectricTrail'),RLA.Parent ,RLA,RLA2)
	EffectEvent:FireServer('Create','DBJTrail',trails:FindFirstChild('BlueElectricTrail'),LLA.Parent ,LLA,LLA2)
	
	local velocity:LinearVelocity

	if root:FindFirstChildOfClass('LinearVelocity') then
		root:FindFirstChildOfClass('LinearVelocity'):Destroy()
	end
	velocity = Instance.new('LinearVelocity')
	velocity.Attachment0 = rootAttach
	velocity.RelativeTo = Enum.ActuatorRelativeTo.Attachment0

	velocity.MaxForce = math.huge
	velocity.VectorVelocity = Vector3.new(0,50,forwardSpeed * foreceMulti)
	velocity.Parent = root
	
	
	dbAnim:Play() -- play animation
	
	wait(0.5)
	repeat
		velocity.VectorVelocity -= Vector3.new(0,10 * downwardsForce,0)
		downwardsForce += 0.1
		task.wait(0.1)
	until velocity.VectorVelocity.Y <= -65

	repeat
		task.wait()
	until hum.FloorMaterial.Name ~= 'Air' 
	
	velocity:Destroy()
	
	-- remove effects
	EffectEvent:FireServer('Delete','DBJTrail',trails:FindFirstChild('BlueElectricTrail'),RLA.Parent)
	EffectEvent:FireServer('Delete','DBJTrail',trails:FindFirstChild('BlueElectricTrail'),LLA.Parent)
	return
end

This is all the code.
This is the code of me getting the animation:

module.GetAnimation = function(Name)
	print(animations)
	if Name  then
		local anim = animations[Name]
		
		if anim then
			warn(anim)
			return anim
		else
			warn('NO ANIMATION FOUND.',anim)
			return
		end
	else
		warn('NO NAME PROVIDED.')
		return 
	end
end

Videos are there now if you need em : )

2 Likes

So uh any ideas cause I again dont think its the script sooooo

1 Like

i dont see an issue can you explain what the issue is with the animation?

Uh well when the animation makes you go upside down it kinda cuts off and resumes in another position, if you look at the videos (which should work now) you can see

It’s probably blending your animation with the Roblox jump/free fall animation. You might need to stop those animations while you are playing yours.

1 Like

Ok yeah that makes sense, any chance you know how to do that? In all 3 years I’ve been doing this I still have no idea

I believe you can call a function on the animator to get all playing animations, then you could loop through them and stop them.

The function is Animator:GetPlayingAnimationTracks()

Make sure the animation priority is action and if that doesn’t fix it then what I did was this:


(Right click and press add keyframe here)

1 Like

OMG WHY DIDNT I THINK OF THAT. Lemme go fix that

1 Like

Yeah, do this, it is a lot simpler.

I shoud’ve thought of that, thanks so much lol.

Specifically setting the priority lol

Your welcome :smiley: I had this problem my self in the past and I figured out on how to fix it by adding more keyframes, also it appears this bug happens if you activate channels.

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