You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
im attempting to make my own Slap Battles game while having the game feel as smooth as possible -
What is the issue? Include screenshots / videos if possible!
theres 2 main ones shown in the video below:
( 1. the torso begins moving before the other limbs, making it feel chunky.)
( 2. the ragdoll seems to sort of explode when launching it with high power. [shown at 0:42] )
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
–ragdoll issue
ive tried turning off the colliders on them, unwelding the torso from hrp causes more issues with it exploding (will remove if possible)
–force issue
(NOTE THAT I THINK BOTH OF THEM ARE CAUSED FROM THE RAGDOLL, FORCE MENTIONED TO BE SAFE)
ive tried turning the bodyvelocity debris high and lower lifetime
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
(the ragdoll function)
module.Ragdoll = function(character, length)
if character:FindFirstChild("Ragdolled") then
module.Unragdoll(character)
task.wait(0.004)
end
local ragdolled = Instance.new("Folder", character)
ragdolled.Name = "Ragdolled"
local key = math.random(1,99999999) * math.random(1,5) / math.random(2,9)
local HolderKey = Instance.new("NumberValue",ragdolled)
HolderKey.Name = "Key"
HolderKey.Value = key
character.Humanoid.PlatformStand = true
character.Humanoid.RequiresNeck = false
character:FindFirstChildOfClass("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Ragdoll,true)
character:FindFirstChildOfClass("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.FallingDown,true)
character:FindFirstChildOfClass("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
character:FindFirstChildOfClass("Humanoid").Jump = false
for _, v in character:GetDescendants() :: {Instance} do
if v:IsA("Motor6D") and v.Name ~= "Glove" and v.Parent.Name ~= "HumanoidRootPart" then
local bsc = Instance.new("BallSocketConstraint", v.Parent)
bsc.LimitsEnabled = true
bsc.TwistLimitsEnabled = true
local collider = Instance.new("Part",bsc)
collider.Position = v.Part1.Position
collider.Size = v.Part1.Size * Vector3.new(1,0.75,1)
collider.Transparency = 1
collider.Massless = true
collider.CanCollide = true
local density = 0.0001
local elasticity = 0
local elasticityWeight = 0
local friction = 0
local frictionWeight = 0
collider.CustomPhysicalProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
local weld = Instance.new("Weld",collider)
weld.Part0 = v.Part1
weld.Part1 = collider
weld.C0 = CFrame.new(0,-v.Part1.Size.Y/6,0)
local a0 = Instance.new("Attachment", v.Part0)
local a1 = Instance.new("Attachment", v.Part1)
bsc.Name = (v.Name.."rag")
a0.CFrame = v.C0
a1.CFrame = v.C1
bsc.Attachment0 = a0
bsc.Attachment1 = a1
v.Enabled = false
elseif v.Parent.Name == "HumanoidRootPart" and v:IsA("Motor6D") then
local weld = Instance.new("Weld",v.Parent)
weld.Part0 = v.Parent.Parent.HumanoidRootPart
weld.Part1 = v.Parent.Parent.Torso
weld.Name = "attache"
end
end
for i,v in pairs(character:GetChildren()) do
if v:IsA("BasePart") then
v.CollisionGroup = "Ragdolled"
end
end
character.Humanoid.AutoRotate = false
character.Humanoid.PlatformStand = true
local yes = character.PastJP.Value
character.Humanoid.JumpPower = 0
character.Humanoid.WalkSpeed = 0
character:FindFirstChildOfClass("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
character:FindFirstChildOfClass("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.FallingDown,false)
character:FindFirstChildOfClass("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.GettingUp,true)
if game.Players:GetPlayerFromCharacter(character) then
game.ReplicatedStorage.Remotes.CameraObject:FireClient(game.Players:GetPlayerFromCharacter(character),character.Head)
end
task.spawn(function()
if length ~= 0 or not length and length then
if length > 999 then
return
end
task.wait(length)
module.Unragdoll(character,key)
end
end)
end
(the force giver)
local lifetime = 0.1
local Velocity=(direction*power)*5 / 3
local bav = Instance.new("BodyAngularVelocity",Target:FindFirstChild("HumanoidRootPart"))
bav.AngularVelocity = Velocity+Vector3.new(-power/10,1*power/30,0)
bav.MaxTorque = Vector3.new(1e8,1e8,1e8)
local velocity = Instance.new("BodyVelocity", Target:FindFirstChild("HumanoidRootPart"))
velocity.Velocity = (direction * power ) + Vector3.new(0,math.abs(power) / 1.2,0)
velocity.MaxForce = Vector3.new(1e8,1e8,1e8)
game.Debris:AddItem(velocity,lifetime)
game.Debris:AddItem(bav,lifetime)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
dont be afraid of asking questions, and any tips (related or not) are appreciated!