Character is strafing horizontally when jumping

Hello, I’m sure you’ve all once encountered this issue, as in the title i am trying to have the character be teleported in front of a NPC, play an animation while anchored, then be unanchored and flung away. What’s happening in the attached video is that

  1. The CFrame of the character’s HumanoidRootPart is set to be 4 studs in front of the NPC
  2. The HumanoidRootPart of both the NPC and the Character are anchored, AutoRotate is disabled
  3. Animation of both plays in it’s entirety
  4. Character is unanchored
  5. PlatformStanding on the Character’s Humanoid is enabled
  6. a VectorForce launches the Character away in the direction the NPC faces
  7. VectorForce expires, PlatformStanding is disabled
  8. AutoRotate is re-enabled.

What I have tried so far:

  • PivotTo() on the HumanoidRootPart
  • SetPrimaryPartCFrame on the character
  • Not setting the CFrame at all, instead moving the NPC to be in front of the character
  • Not anchoring the Character’s HumanoidRootPart
  • Resetting the C0 and C1 values of the RootJoint both after PlatformStanding is disabled and when the character recovers from the Ragdoll state (This works, but only about 50% of the time)

Video

Code Involved

  • Code when the player is initially grabbed, details steps 1-2
character = part.Parent
								character.Humanoid.AutoRotate = false
								character.HumanoidRootPart:PivotTo(NPC.HumanoidRootPart.CFrame * CFrame.Angles(0, math.rad(180), 0) + NPC.HumanoidRootPart.CFrame.LookVector * 4 - NPC.HumanoidRootPart.CFrame.UpVector * 1.245)
								character.HumanoidRootPart.Anchored = true
								characteranim = character.Humanoid.Animator:LoadAnimation(anims.backbreakvictim)
								characteranim:Play()
								characteranim.TimePosition = anims.backbreak.TimePosition
								NPC.HumanoidRootPart.Anchored = true

Code when the player is thrown by the NPC, details the rest of the steps

local currentcharacter = character
	currentcharacter.Humanoid.PlatformStand = true
	currentcharacter.HumanoidRootPart.Anchored = false
	local force = Instance.new("VectorForce", currentcharacter.HumanoidRootPart)
	force.Attachment0 = currentcharacter.HumanoidRootPart.RootAttachment
	force.Force = (NPC.HumanoidRootPart.CFrame.LookVector * 20 + NPC.HumanoidRootPart.CFrame.UpVector * 5) * 500
	wait(0.5)
	force:Destroy()
	currentcharacter.Humanoid.PlatformStand = false
	local cor = coroutine.wrap(function()
		local connection
		connection = currentcharacter.Humanoid.StateChanged:Connect(function(newstate)
			if newstate == Enum.HumanoidStateType.Landed or newstate == Enum.HumanoidStateType.GettingUp or newstate == Enum.HumanoidStateType.Freefall then
				currentcharacter.Humanoid.AutoRotate = true
				--repstorage.event:FireClient(players:FindFirstChild(currentcharacter.Name), "resetrootjointc0andc1")
				connection:Disconnect()
			end
		end)
	end)
	cor()

forgive my wack codeblock formatting

this can be because of a part that is not meant to be welded/rigged onto the model.

You would think that would be the issue, but even after removing all created welds entirely the issue persists. The only forces acting on the character are in the code blocks shown.

can you provide a download link so i can check it out please?

i think i know whats happening, the weld is adding a pivot offset to something and causing it to do that.

There’s no welds used at any point in the script, so it can’t be causing the problem.

for me your code is obfuscated, it shows
<roblox!‰ÿ


META$ " ð ExplicitAutoJoints trueINST$ 6 ð Animation €INST ð Script INST ð

StringValue PROPˆ ñ ÿ
AnimationId rbxassetid://9144051351e 58871309e œ48581769Q ¿13197986021 9078856 218066898 Ÿ2175588638 €23110102PROP* < ð
AttributesSerialize P PROP_ m Ð Name °idle run ø"walk
attackcombo crash backbreak_victim * p_victimPROP’ V ð
SourceAssetIde !€PROP - Ð Tags
P PROP" ð AttributesSerialize PROP ð Disabled PROPe ð
LinkedSource PROPe ð
Name AIscriptPROP ð
RunContext PROP? = ð.
ScriptGuid& {DFDBF39A-BECE-4BD1-8C07-32B99EE8D427}PROP—e WM ò& SourceDM local players = game:GetService(“Pe 2”)

  • òknight = script.Parent
    ô.HumanoidRootPart:SetNetworkOwner(nilJ ódistance = math.hugee Ptargee 4nil Rweens– ¨ T ¶ ­ pastphraseÜ #{}L ©connection Bvalu) `
    coun ò0,
    attackcombobou² Ycrash @statÐ ð"idle",
    overrid ôfalse,
    theta = 0
     €footstep H.$ eholder Ñ @anim> ~{
    walkH â.Animator:Load
    Cion(Å 5 ),
    run< 0run; ò < 5 = bD < K •E 6 ? backbreaD: G fvictim/& _ A
    }

¾:n3()
×1fun¦ ñ
sound(ID, volume, speed, p‚2)
¡( R = In_p.new(“S> ”- ’ . ô
Id = “rbxassetid://” … ID’ Vr # ={ ® Ñ S‰ " =‘ pOnRemovÿDtruee ¶RollOffMaxDC4000! í:Destroy()
end@stopV K()
0E.Wal 20
[ ßP:Stop2 5run \s u D ? -
þ ²2 --setting
U for 0 R
if } L 0.IsA - =s then
µ ¢ 8 #% Z ·
‘10 Pws
ç • I Ó ’ " ~ < ª?run&
G3.75‰ Ä)?run(°.uðrunning" – changË
B
V i ‹ ¸ U3Ì U=Fchat«jCHttpç H : EChat, ?tex, 4Texe"§°askGPT(ques] 1, si›2req‡ € req.urlxðhttps://api.openai.com/v1/compleJ "s"3 Bhead¨ð {
[“Authoriza% ó”] = ("Bearer "…ÝóAPI_Key.Value)
 !da‡ I QmodelA "À-davinci-003È ‘ ["prompt$ ô(“Q: Answer this ò ð
as if you were a giant hulkðbrute that is extremely hostile and activ Ù 7 the persa u °. Address wY ò"they say but do so in a violent manner. Use uniquw Ðvaried respon0 Œ ò
do not directly quote fromø “dedQion oø rz@ractc @Only
akƒ ‰full cap[ ðuse profanity or tÀPabout arefferò Ç €approprif Òsubjects: \n ¦
!: ¸€ …”\n A:”“ á ["temperatureÈ0 ¡max_tokens 1‰}P @
t† Ä U
4[1]µ’ ×’‹

  • a`r _, vgpairs(# p) do
    •Kv ==> k continue  y ˆ r… "', Œ Av
    4 #ifž h ""b
    € H ™„Rdata.
    p

C/me±·2. DW ü R¾sAƒq. Never’ 1mor8Žn 8 word. <oq 0 a maximum—Ætwo sentence~ brepeat4 ±have said‰ r±ast. So farÓ" h # k Œ ‡0lseè Pÿ¯õAnd
û
| {ÿ4 ( ù w¿o ú nÿC‰ jè Ý
Z7 =
Ä:JSONEncode(| žû

3 ‘PostAsync2 @url,X ,Enum.[ CoZ ÁtType.ApplicÐ RJson,ô j º)Èg U T.sub( , Gfind !"\˜Ï\"") + 8, -1L gM p"\\", " UprintR = < 2Œ P") - ‚ V “ n” 1 ",k 0F  ’:FilterS7”Nª, 24523798Ú Ô0Nonì? rForUserF < ptable.ikt› ,e )= #· Q > 10< 5 0[11’2nil« ereturnG ېrepstorag* ƒ"ReV2edS% { °chat(messagäQ ó.event:FireAllClients("send/ 3", 0) H n -(S5ead( ™, "White"+Pmiser>õ … û t²qinfo = ¾AInfo®11, _àEasingStyle.Qu D•„ion.Out)FÉ íòMarkerReachedSignal("leap"):C (( ! ˜ ) =ru:Create
ç,- Í q, {CFra.ü
1 .$ "* ¢.Angles(0,°rad(180), 0ðI ÿ .LookVector * 33 %Up1 1.245} é$if’ °ndom(1, 10)41ñ! 3(û€"You are ¼ after me˜àperform a aeriw€owerbomb "))ÃCend)Ó OgrabÓíweldconstraintUWeldC 3", ë R MpartB ì&t0]) / aAnchorU 1e?.Torsoplummet wDaAdjust®(w‚ 4k‚ In<KŽ [ E2!?new~MP.X, 4Éʧ) Z)ìª ï “.C/ed2
` µ Ð:TakeDamage(6}0ùcor = coroutine.wrap™) urèk3 & t Öty StÔ‹X !fo
0eF -”,| \ è ô J .A.Ahmen+– : . 4 ˜ H | 2 = Š 3(Š@0, 5"55£ Q * 50i` wait(®\ « £
9Á:»¼q ioß& Õ û¸SNCÉ‚1newÜ{³ ž) I ¡
`LandedZ- GÍ/Up0 „Freefall ] PAutoRý ô 1 6 -- ½º(©ýs:FindFirstChild(g ðName), “resetrootcf•
f ƒC:Dis ! ^ *!or# cr Q ƒ” lˆ a ö
m on me t
ÿ?, 5ˆ ðrapidly descending towaB ä gra, whild ( % a “ 0 atØ sÛ!ti‘ðnleash a incoher_Xroar!â¯,÷ phonetic sw -s.è
ö.­ep ý J u"t vó "vev
v5,s.È! c – ´""R Ë ¸a
/sna



.TimePosiÛe‡ += 0.05i /
$ =^qC
;
 Âܲ 3I |¹°(9113959343
V, 0.6u0ead;
tY ² w ³ H}Otoss
Œ
&
C A0 ˆˆ á s0H q.F oe

i

D20 +7m þ ¹
g
5• ¦%sit(0.5) ’X
ˆUŽ( ý& ¼
™Š5ˆ‚S †„Qˆ
x ·÷ z XOloopó× ] Yw0xÛê(F+= 1 { ò(- “ú( 9if Q >IÑÌ) C , 0= 0÷ *X3ïs Sren()Ç ‹ $.C‡ z (or A "¿"U µ 1 £Health <= ô’õ / erÕ h ºOabs(ì-¨ w W( ).Magnitudñ
v «‘ !if=(ˆ <  u+?andh ÀSlth >Þ F 7 =O e b 4 ~=í0 Ë
î
y =
& } Ý/tt

ða¨##= £ # ,ò - k (, o I ‹’ à ‰ ¯ $if
gD
®
%"_5ingöò!’ ¦== "circle$ XdeltaTheÝX.0 * Ý 
såŸ jt1 ( +N Q) % (P ppi * 2)H H’Ca degre— 3x =7 9cos^ î03.5Á8 ¸$o
× .Xw aradiusÀ Æzf ?sinf 0eZf ü— ˆ:MoveTo(}xã X”P.Y, zà è Z ? .¨
û²† É
2K()

ÈàŒC Ö Ë $5 úå ›"
‚ ¹›>fd0 ‡ ç,Bmy h”"isá%L ‘½"C&f2
3MaxÑ 5 %. Á—"lyA 6Ä * G e ·‘"re* +& ²meters away8’/meö ÿzÃB0, 3Hc.:0tod52 @1, 4û¨ ¼»Ó%š D<= 6€ { V A<= 3e ¢, normallyÅ£ ÿ3àÂC 1 L  6ó 
s[V5()]É
6 ê Òohitboxö pañ ~ ¯€swingids‰£ Ó 5835032207, §9126013639 w0728815 $ 24775 } ö %j e[¨# !)]e 80Qo0)/100o Ð ç µ Ò … 4 ñ è Ù ½’ ñ%¦ ¼Aspot‹2! L [< ‹sm Ñ,¾ ")à ! )les! +P
e = © ] Š
I0u  t 1ô0#ot{ \ ³ 7 4 1+ 2[ É: â YCuntiOP B= “”- P0touMÄ m\´ ’ ”

{
!v)qj l =ð’Qkspac˜5 à0sIn J
T[v]) = Œ ¿ Ç’a
¸ 7ing  & Ô ·#~=ÈÍ ® )
ã 0h „ ^ S
1 \
¸
u
. ™k3[1] ²
è ¤5507830073È ™911797019 , _æ êåà Ý ´ K{ M  ~ e1 Þ
Ÿ/f 1hitb "pu¶2j “atÍ ¢ Å
­àe - 㘠ž þ3 ; òš ] 2’ ƒ ÀAlignOrientav0.EnÏ 3ej ³ øà y ª œ W j L + È &.A sÈ´ < *ö ² d µÎ A== 4> Ö + È Â º 6ØZ˜* º¹?ˆ¸e/LlÚ f7]\{ ÿ) [ ^ ÄS° - Q a ² ¹ ¨ ‹ O ! Wº"D R ‹ ÍÖ / º#R#
Y! ’%Ê F
$%34 -òÆ
— º!%Ó |
6#ï&6‹Ødf ö
Û#É’½&%
ò À&&h&0000{# ¹ •
H# ° Õ  þ 4š& þ@laun°
ž&@into
A air
Ä&†6¹&p ‚
¼ ð%·ˆ W Ö"D
5 å: ~
ç¢1.% 2†ÿ – WHAT YOU ARE WORKING ON 5 Î f ÿ†Þ=mÒ :”) < 26Æď ÁøÉ $

"
Ù

Æ û ; Šk

P 6 ¶’è!>›1c ˆ\ ‡
s ™= HÏ ˜–


”uv‰ ] u
+eQ
²r ? kt

  • Ë
    e[
    ã . K ƒ:PivotTo¬N ’+á tW Ò 3 ÷ òà õ …G 1 bFŒ ( E v %e@ 5ÿ 4 Î ¹ á å$2% ] 5 щ Í Æ K Da "Ÿ0 y É 4 5 ±ÓÈc U o! !œe €&((; 2= 8Y0 ~¡GßD e ´ P! - ; åe_ ^ ˆF¾_ D Î àHÌè ‘ " 3Û × y b 0–#à F 4p 5R ä í+ž
    
    end
    endPROP ð
    SourceAssetIde PROP ð Tags PROP" ð AttributesSerialize PROP ð Name API_KeyPROP ð
    SourceAssetIde PROP ð Tags PROPG E ð6 Value3 sk-kqpvQv8goFV5fLzGfwhzT3BlbkFJHD7sNPLBBGREKO5KRhh6PRNT U ?

    *
    € END

im so confused, openai? are you making a chatbot or is this obfuscated code messing with me

The script seems to open fine on my end when I import it into studio, and yes, part of the script does use ChatGPT

oh alright, speaking about chatgpt, theres this chatbot exploiters use and after some research i found their code but theres this weird syn thing and ive been trying to convert it into an http request but it doesnt work, code:
repeat wait() until game:IsLoaded();

– // SETTINGS \ –

local SECRET_KEY = “secret key here”; –OpenAI API
local CLOSE_RANGE_ONLY = true;

_G.MESSAGE_SETTINGS = {
[“MINIMUM_CHARACTERS”] = 1,
[“MAXIMUM_CHARACTERS”] = 128,
[“MAXIMUM_STUDS”] = 15,
};

_G.WHITELISTED = { --Only works if CLOSE_RANGE_ONLY is disabled
[“seem2006”] = true,
};

_G.BLACKLISTED = { --Only works if CLOSE_RANGE_ONLY is enabled
[“Builderman”] = true,
};

– // DO NOT CHANGE BELOW \ –

if _G.OpenAI or SECRET_KEY == “secret key here” then return end;

_G.OpenAI = true;

local ReplicatedStorage = game:GetService(“ReplicatedStorage”);
local Players = game:GetService(“Players”);
local HttpService = game:GetService(“HttpService”);
local LocalPlayer = Players.LocalPlayer;
local SayMessageRequest = ReplicatedStorage:WaitForChild(“DefaultChatSystemChatEvents”):WaitForChild(“SayMessageRequest”);
local OnMessageDoneFiltering = ReplicatedStorage:WaitForChild(“DefaultChatSystemChatEvents”):WaitForChild(“OnMessageDoneFiltering”);
local Debounce = false;

local RequestFunctiom = syn and syn.request or request;

local function MakeRequest(Prompt)
return RequestFunctiom({
Url = “https://api.openai.com/v1/completions”,
Method = “POST”,
Headers = {
[“Content-Type”] = “application/json”,
[“Authorization”] = “Bearer " … SECRET_KEY
},
Body = HttpService:JSONEncode({
model = “text-davinci-003”,
prompt = Prompt,
temperature = 0.9,
max_tokens = 45, --150
top_p = 1,
frequency_penalty = 0.0,
presence_penalty = 0.6,
stop = {” Human:“, " AI:”}
});
});
end

OnMessageDoneFiltering.OnClientEvent:Connect(function(Table)
local Message, Instance = Table.Message, Players:FindFirstChild(Table.FromSpeaker);
local Character = Instance and Instance.Character;

if Instance == LocalPlayer or string.match(Message, "#") or not Character or not Character:FindFirstChild("Head") or not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("Head") then return end;
if Debounce or #Message < _G.MESSAGE_SETTINGS["MINIMUM_CHARACTERS"] or #Message > _G.MESSAGE_SETTINGS["MAXIMUM_CHARACTERS"] then return end;
if CLOSE_RANGE_ONLY then if _G.BLACKLISTED[Instance.Name] or (Character.Head.Position - LocalPlayer.Character.Head.Position).Magnitude > _G.MESSAGE_SETTINGS["MAXIMUM_STUDS"] then return end elseif not _G.WHITELISTED[Instance.Name] then return end;

Debounce = true;

local HttpRequest = MakeRequest("Human: " .. Message .. "\n\nAI:");
local Response = Instance.Name .. ": " .. string.sub(HttpService:JSONDecode(HttpRequest["Body"]).choices[1].text, 2);

if #Response < 128 then --200
	SayMessageRequest:FireServer(Response, "All");
	Debounce = false;
else
	--warn("Response (> 128): " .. Response);
	if #Response - 128 < 128 then
		SayMessageRequest:FireServer(string.sub(Response, 1, 128), "All");
		delay(1, function()
			SayMessageRequest:FireServer(string.sub(Response, 129), "All");
			wait(1);
			Debounce = false;
		end)	
	else
		SayMessageRequest:FireServer("Sorry but the answer was too big, please try again.", "All");
		wait(1);
		Debounce = false;
	end
end

end)

warn(“Script has been executed with success.”);

any way to convert it into a normal local script that you know of?

can you provide a link to the model? i got an error.

I can’t provide a full model atm since it contains some sensitive information, part of which is very important for the model to function. But, you can easily recreate the bug just by following the steps I listed. I’ll try making a new script that recreates it.

i have assumed this was placed in your model, but when it touched me it freezes.

speaking about sensitive information you left your key in the value
image

That’s what I mean, hadn’t occured to me till I posted it

i changed it to my key so it doesnt affect your account though
image

This would be because there are no animations, and I can’t give you them since Roblox only allows animations to be used by the person that uploaded them.

i have btroblox so i can download the animations, is that okay with you?