What's better, AdjustSpeed or AdjustWeight?

Let’s say i want todo a cool slow motion animation or just plain make a animation slow up or down based on a sound loudness, would it be better to go with weight or speed? (note that i have a animation that will play on the bass hit )

One thing adjust influence of animation and other adjust speed on which timeline of animstion will run, i dont quite understand you

1 Like

Well i am trying to recreate this smooth looking effect from the animation :

Notice how it smoothly plays the bass hit animation and goes back to the dance too, but my idea , my guess is it it’s using adjust weight, but i am wondering if that same effect is possible using adjust speed

1 Like

Nope it wont.
I weight is mainly used for fade in/out internally only so you should use speed instead.

1 Like

I recommend just reading the documentation that goes in-depth:

The Adjust weight is for one, basically priority of animation, and two, the more important thing here, how long it takes to transition from one animation to another. The higher the weight, the “quicker” it would transition.

It seems though that you only have one animation playing on loop, and thus adjusting the speed is what makes sense here, not the weight.

Weight of animation starts being interpeted from max to 0 when animation reaches fadeout and the opposite when it fadein
Weight of animation is not related to priority as it is a result that produced prior to it aka CFrame.idenity:Lerp(cf,Weight)
Fadein and fadeout values is not readable in AnimationTrack class ,targetweight is a static NON interpeted version of weightcurrent i know that because i did reverse engineered it kinda.
Blending and mixing IS NOT RELATED TO WEIGHT as since its a 2 separate processes and weight is independent to priority als Weight is a linear proccess (as of rn)

2 Likes

That looks like both ways at times.

AdjustWeight for smooth
AdjustSpeed for punchy

Weight will NOT help here at all.
Weight is a range from 0-1(although pretty sure it can be higher than 1 and will overshoot keyframe’s cf position) and it controlls cf of animation 0(no movement) and 1(regular movement) and in between is usually a value during fading in or out

1 Like

I guess we’ll see what he thinks…
I know I would test it every way possible and pick one.

1 Like

I just got on my hands some code from the game on the video, Let’s say, they used weight, Creative, I’ll come with some formula/ideas, Thank you all for the information


local C3 = Color3.new
local V3 = Vector3.new
local Angles = CFrame.Angles
local random = math.random
local rad = math.rad
local Config = {
	fovBase = 70,
	fovInt = 0.05,
	--tintBase = 0.005,
	--tintMult = 0.0025,
	brightBase = 0.001,
	brightMult = 0.001,
	SETTINGS_LIGHTINTENSITY = lightIntensityValue.Value,
	blurMult = 0.025,
	SETTINGS_BLURINTENSITY = blurIntensityValue.Value,
	shakeMult = 0.005,
	angleBase = 0.01,
	maxAngle = 45,
	maxAngleOffset = 0.15,
	SETTINGS_CAMSHAKE = camShakeValue.Value,
	hue = 0.7915,
	hueSaturation = 1,
	hueValue = 1,
	hueSpeed = 0.0001,
	SETTINGS_COLORSHIFT = colorShiftValue.Value,
	
	tweenTime = .05, -- every config depends on this
	offColor = Color3.fromRGB(255, 80, 80),
	onColor = Color3.fromRGB(101, 255, 67),
	
	genMult = 1
}
local function v1(flooredOnly)
	local loudness = NormalSound.PlaybackLoudness
	local floored = math.floor(loudness)
	local clamped = math.clamp(floored, 1, math.huge)
	
	if flooredOnly then
		return floored
	elseif not flooredOnly then
		return clamped
	elseif flooredOnly == nil then
		return loudness
	end
end

local function handleAnim()
	for _, v in animationsList do
		if v ~= nil then
			local Anim1 : AnimationTrack = v[1]
			local Anim2 : AnimationTrack = v[2]
			Anim1:AdjustWeight(v1(true) * 0.0075)
			Anim1:AdjustSpeed(v1(true) * 0.005 * Config.genMult)
			Anim2:AdjustWeight(0)
			Anim2:AdjustSpeed(v1(true) * 0.0075 * Config.genMult)
			if currentSong ~= nil then
				if v1(true) > currentSong.bassHit then
					Anim2:AdjustWeight(5 * Config.genMult)
				end
			end
		end
	end
end

Btw just to let you know manually indexing stuff like:
local color3_new = Color3.new
Is not needed if you are in optimize 2 mode (set by default)
Although it only applies to luau globals and not user made tables

1 Like

So, you would say it’s a bad practice?, but thanks for letting me know

1 Like

In optimize 2 yes
In optimize 0 and 1? Its a good practice

1 Like

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