How do I fix this stuttering?

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)

Im not trying to ask anyone to do anything for me, I just don’t understand how to use what you gave me. You have given me pretty vauge answers to my questions and Im probably going to give up at this point and figure out how to use BodyGyros for this.

Plus, just throwing code at me isn’t really going to help if I don’t really get what it does. Youve said it aligns two vectors, but how? What part of the code aligns them? How do I calculate the vectors and such? What do the functions and stuff in your code even mean? Faux? scalar? getScalar()? getNormal()? getRotationBetween()? I don’t know what the code you put in them is, so it can’t help me much because they are obviously needed to get an effect like I wanted. Where is attractor referenced in the script? What is attractor?

Can you slow down the tween(to like 3 or 4 seconds) and see where exactly the stutter happens?

Sure. Let me set it to 3-4 seconds and record it rq.

Hmm, the stuttering happens when the character trys to rotate on its x axis. Try lifting the root part just a bit off the ground.

That would easily be a fix, yes, but I would prefer to not do that as I want it to look like they are still on the ground. Is there really no way to make it only tween the Y axis in that direction? That would be a solution for me…

1 Like

You have 2 options:

  1. Change the CFrame of the HRP manually every frame.
  2. Don’t tween the HRP to look up. (Tween its rotation on the Y axis only)
    Try this:
function turnCharacter(hrp,target)
	local angle =  CFrame.new(hrp.Position,Vector3.new(target.Position.X, hrp.Position.Y, target.Position.Z))
	
	local TS = game:GetService("TweenService")
	local info = TweenInfo.new(1)
	local goal = {}
	
	goal.CFrame = angle
	
	local tween = TS:Create(hrp,info,goal)
	tween:Play()
end
3 Likes

How about changing the second parameter of the cframe.new into Vector3.new(target.Position.X,HumanoidRootPart.Position.Y, target.Position.Z)

1 Like

IT WORKS!!!
WOOOOO!

Tysm, and thank you to everyone else who help me here. I knew there had to be a way, thank you guys!

2 Likes

Also, your response works too, I can’t mark both of you the solution though. Ty!

1 Like