Help with Grab Move

I’m trying to make a Grab and Slam move, currently I am welding together the HumanoidRootPart of both players. The problem I’m currently facing is at the end of the animation the enemy player would move back to its original position since it is moved in the animation.

I’ve tried pausing the animation at the end of the slam, then stopping it and instantly playing the same animation frames just with no torso movement as a bootleg method but i’ve had no luck.

What I’m trying to achieve is keeping the enemy player in the position where they are slammed in instead of going back to its original position after the animation.

6 Likes

Problem is that the HumanoidRootPart isn’t moving with the animation, so even when welded, the NPC isn’t actually technically moving with the animation, moreso just everything except the HRP. One of the quickest and simplest possible solutions is to just set the HRP’s CFrame to the torso’s CFrame at the end.

NPC.HumanoidRootPart.CFrame = NPC.Torso.CFrame

As for triggering the bit of code, I highly suggest looking into animation events so you could easily trigger it at the end of the animation, moreso so there’s no any kind of snapback when the animation ends. (roblox has that kind of jank)

3 Likes

Okay so I added an animation event and tried CFraming the enemy player once that event is reached but I had some problems, luckily I found the best result i’ve gotten so far from just changing the weld CFrame.

It looks way better than what it looked like before but I still have a snapback issue in the animation. I’ll put an example video aswell as my current code.

animloader:GetMarkerReachedSignal("End"):Connect(function()
			WC.C0 = WC.C0*CFrame.new(0,0,-7.5) 
			WC.C1 = CFrame.new(0,0,0)
					
					
getSet("mod_animation"):playAnimation(EnemyPlayer,15090782889,.5) --Clone animation of end frame with no torso movement to try and prevent snap back
		animloader:Stop() --Stopping the grab animation
			
				
			EnemyPlayer.Humanoid.PlatformStand = false

				
			task.delay(.3, function()
					WC:Destroy()
					for i,v in pairs(EnemyPlayer:GetChildren()) do
						if v:IsA("BasePart") then
							v.Massless = false
						end
						if v.Name == "HumanoidRootPart" or v.Name == "UpperTorso" or v.Name == "LowerTorso" or v.Name == "Head" then
								v.CanCollide = true
							end
						end
					end)

				hum.WalkSpeed = 13
				hum.AutoRotate = true

				EnemyPlayer.Humanoid.WalkSpeed = 13
				EnemyPlayer.Humanoid.AutoRotate = true
			end)
2 Likes

Found a solution, by setting the fade time parameter to 0 i was able to stop the transition instantly

animloader:Stop(0)
4 Likes

Hey, I know this topic is solved but I have a question and a response would be appreciated. How did you make the enemy follow the players arm so precisely like that? what parts did you weld and what things did you involve to make the enemy follow whats happening in the animation?

1 Like

As for the grabbing part, I’m pretty sure he just used welds (as you said) or motor6d (so you could also use it on bones and such). However, for the response to being grabbed, he probably just checked if the player was grabbed, and if so, an animation plays. Once the animation is finished, the player sits down using Humanoid.Sit = true. That does require a little choreography, but if you just speed up the animation, it’ll be fine.

1 Like

I welded both of the players humanoid root parts together, and I set the cframe of the weld to make the enemy player positioned infront of the user, I basically manually copied the starting positions of the animations to make the animation as smooth as possible, for example my animations were made in a sense where the enemy being grabbed was infront of the user, so inorder for the animation to align I had to position the enemy infront of the user and facing the user.

1 Like

Thank you, I appreciate that a lot, for some reason I can’t find any articles on scripting this kind of stuff.

2 Likes

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