How do I fix this stuttering?

If I rotate the waist, does the whole model rotate as well? Also, what do you mean by multiply its cross and dots?
I just need to know how to turn this:

local angle =  CFrame.new(hrp.Position,target.Position)

into the criteria you just described… maybe a script example or something?

local function getRotationBetween(u, v, axis)
    local dot, uxv = u:Dot(v), u:Cross(v)
    return CFrame.new():Lerp(CFrame.new(0, 0, 0, uxv.x, uxv.y, uxv.z, dot), 0.5)
end

so u is the look vector of the player, v is the up vector of the basketball thingy and axis is 0,1,0

Will I still need to use tweens here? How do I apply that cframe on an object? Does this still rotate the player’s character up and down (which is something I don’t want to happen…)? Ive never worked with :Lerp() before and Ive always found it pretty confusing…

Sorry if I am being frustrating, Im not that good at scripting…

Think of tween as basically just doing :Lerp() in a for loop

That doesn’t answer much of my questions… how do I apply this at all? How long will it rotate the player towards the basketball net? I only want it to happen for about 1 second.

Well then if the range is from 0 to 1 you can just have your iter be (1/the amount of steps, resolution in a sense) * 1 --ignore the 1 ig, just putting it in here if u want it longer

I might just try using BodyGyros at this point, this seems really complicated and at this point I don’t even know how I would apply this to my code AT ALL in the slightest bit.

Is anything anchored when you play the tween?

The point of that is that it allows you to align vectors while also not making them face direction to each other, almost perpendicular in a sense which is the whole point so they just rotate on the y and a bit on the x as fast as possible (cause this quaternions)

Try making the humanoid fling state or whatever, forgot the property to false

Nothing is anchored at all. I just simply tween the HumanoidRootPart’s CFrame to a cframe that consists of

CFrame.new(hrp.Position,basketballNet.Position)

ok so see this


the player is flinging because its glitching under the ground, my way makes it take the shortest path of rotation to it with quaternions. Remember, the humanoid forces stop it from gltiching under but it also causes this studdering effect. Either do it the way I showed you or disable the humanoid forces making it stand up

1 Like

Try anchoring the root part while the tween plays.

So this brings me back to my first question I had…
how do I turn this

local angle =  CFrame.new(hrp.Position,target.Position)

so it only makes it edit the hrp.Position.Y value?

Im tweening the root part, so wouldn’t not move at all?

Yeah I just gave a random solution, I thought the gravity would pull it down while it lifted off the ground.

like i said do it my way but only update the y component smh

Like I said, I have no clue what your function even does. I just don’t understand it, or how I would apply it to my code. How would I take what your function returns, and make it work with what I have now? Ive said this multiple times :confused:

it literally just aligns two vectors to be perpendicular

1 Like

Im not that good at scripting, plus, I still haven’t gotten an answer of how I would make it work. How I would take what it returns and put it into my function. Would I do something like

hrp.CFrame = -- what your function return.

Im terrible when it comes to CFrames and math in programming.

damn, thats sad then. maybe go find some kid at grp to do it for you

I had to dig through my files but this is how I did it in a game of mine

local scalar, faux, difference = getScalar(char)
			local normal = getNormal(char, faux)
			normal = char.HumanoidRootPart.CFrame:VectorToObjectSpace(normal)
		local force = scalar * normal
		attractor.Force = force
		local u = char.HumanoidRootPart.CFrame.UpVector
			local axis = u:Cross(normal)
			char.LowerTorso.Root.C0 = CFrame.new(0,-1,0,1,0,0,0,1,0,0,0,1) * getRotationBetween(u, -normal, axis)
		end)