Body movers stop working after character death

CC Project Associates: @Immites @Scarital
Hi all, I usually would not need to make such a post, however this bug has plagued me for days and is now slowing down the speed of development on an important project.

To put it simply, I have a script which flings players using a LinearVelocity object. This script works perfectly fine when the player stays alive during use, however, when they die, all interactions with this LinearVelocity instantly cease and the player drops to the floor. This is not the intended behaviour, and I have no clue why it has begun occurring.

So far I have tried editing many of the scripts in my game, such as a rag doll system (e.g. checking humanoid states), the fling system (updating from BodyVelocity to LinearVelocity), and the invocation of the functions. None of these solutions have worked. I will attach various code snippets below which are used throughout the project. If any more content is required then please let me know and I’d be happy to attach them.

LOCALSCRIPT FLING

function onPlayerFlingClientEvent(Part, Point, Power, Stun, SetVelocity)
	
	local Attachment = Instance.new("Attachment")
	Attachment.Name = "TEMP"
	Attachment.Parent = Part
	
	local linearVelocity = script.LinearVelocity:Clone()
	linearVelocity.Parent = Attachment
	linearVelocity.Attachment0 = Attachment
	linearVelocity.Enabled = true
	if SetVelocity then
		linearVelocity.VectorVelocity = Point;
	else
		linearVelocity.VectorVelocity = (Part.Position - Point).Unit * Power;
	end
	
	Debris:AddItem(Attachment, 0.15)
end

INVOCATION OF FLING SCRIPT

shared.FlingPlayer:Fire(Victim, Character.HumanoidRootPart, Vector3.new(0, 25, 0) + (HitPlayerPos - CasterPlayerPos).Unit * 75, -120, true, true, Caster)

CLIENT-SERVER COMMUNICATION

shared.FlingPlayer.Event:Connect(function(who, part, point, power, stun, setVel, casterPlayer, sp)
	if typeof(who) == 'table' then
		FlingItem(who.Character, part, point, power, stun, setVel);
	elseif who:IsA("Player") then
		if who == casterPlayer then
			if sp == "trip" then
				ClientFling:FireClient(who, part, (who.Character.HumanoidRootPart.Position - (who.Character.HumanoidRootPart.Position + who.Character.HumanoidRootPart.CFrame.lookVector * 10)).Unit * 10, power, stun, setVel);
			else
				ClientFling:FireClient(who, part, Vector3.new(0, 25, 0) + (who.Character.HumanoidRootPart.Position - (who.Character.HumanoidRootPart.Position + who.Character.HumanoidRootPart.CFrame.lookVector * 20)).Unit * 75, power, stun, setVel);
			end
		else
			ClientFling:FireClient(who, part, point, power, stun, setVel);
		end
	end
end)
1 Like

Update: I’ve tried checking the weight of the character, disabling the rag doll completely, and a few other methods which I guessed would work but the character still drops to the floor if they’re still being flung whilst dead.

I also tried initiating a stun after death, but this simply doesn’t do anything at all.

1 Like

Although the BodyVelocity object is deprecated, i’d highly recommend using it in this case as it doesn’t stop whenever the character dies.

Unfortunately, you can’t find the BodyVelocity object when inserting it into studio. Instead, you should create one using the following script in the Studio Command Line:

Instance.new('BodyVelocity',workspace)
1 Like

I had been using BodyVelocity previously, however it resulted in the same process. The character still drops to the floor when they die

1 Like

Having this issue, I would make a bug report if devforums would let me. Thanks, Roblox!

1 Like

I’m going to make a bug report, as I discovered upon further testing that the issue would only occur if the humanoid has less than 100% of it’s health at the time of death, which is most odd.

1 Like

In order to save you a headache, heres how I “fixed” it.

The moment the character died, I would change the humanoid state of the character to Enum.HumanoidStateType.Dead (lol). I would then apply impulse on the localside (fire a remote to a localscript on the victim player to do the flinging)

This is all completly undocumented and its either a bug or undocumented behaviour. At this rate im just gonna code my own character system

1 Like

I had fixed it by manually changing the health to 100 upon death and maintaining a stunned state. I am still yet to make a proper bug report, though it will be done when I have the time to complete such a post in detail.

1 Like

I apologise for bumping this thread as it one year old, however, I would just like to post the solution to this problem in the case that it occurs for others.

The solution for this problem was to set the network ownership of the player’s character to the player. The fling effects were causing disputes when the player died due to unexpected velocity when they died (at least, this is what appeared to be the case during my testing, especially since the velocity was being applied to the player via the client).

1 Like

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