Okay so, is the part that is inside the player
CanCollide = false
Massless = true
Because if these properties are not the same as i just said, it might be causing some issues.
ohhh i get it now, you’re talking about in the video, yea that part is just a hitbox, i tried removing the code that spawned it before i made this post and nothing changed
Oh, Alright i think instead of using LinearVelocity it would be better to use BodyVelocity since even
if you get LinearVelocity working it still has some problems of its own. Here is a basic example of using this
local BV = Instance.new("BodyVelocity")
BV.MaxForce = Vector3.new(1,0,1) * 30000
BV.Velocity = root.CFrame.lookVector * 110
BV.Parent = root
task.spawn(function() --this makes it so the player doesnt just zoooom off the map
for count = 1, 8 do
task.wait(0.1)
slide.Velocity *= 0.7
end
BC:Destroy()
end)
I haven’t tested it so i don’t know if it works, but it should work since it use it in my other projects.
You should not be creating a new linear velocity every frame. Instead, create one linear velocity and update the properties (e.g. change the velocity direction or change whether it’s enabled.
The problem here I bet is that:
First: Your velocity is insanely fast . A character walks at 16 studs per second by default. Your velocity is 100,000 studs per second.
Second: When you create two linear velocities with different directions (b|c you make one every frame), the linear velocities probably use all their force to cancel each other out.
Note that Debris only roughly destroys the item at the correct time, so you shouldn’t rely on it to destroy the object at exactly the right time.
Perhaps try something like this:
local player = game.Players.LocalPlayer
local char = player.Character
local hum = char:FindFirstChild("Humanoid")
local runanim = hum:LoadAnimation(script.RunAnim)
local root = char:FindFirstChild("HumanoidRootPart")
runanim.Priority = Enum.AnimationPriority.Action
local isActive = false
local function activate()
-- Only activate if not already active
if isActive then return end
game.ReplicatedStorage.Remotes.Cyborgs.RunningBlast:FireServer(char,root,hum)
-- Start the run animation
runanim:Play()
-- Create a LinearVelocity
local BV = Instance.new("LinearVelocity")
BV.Parent = root
BV.Attachment0 = root.RootAttachment
BV.MaxForce = 100000
-- Update the velocity direction every frame
local connection = game:GetService("RunService").RenderStepped:Connect(function(frame)
BV.VectorVelocity = 32 * root.CFrame.LookVector
end)
-- Optional: End the dash after 5 seconds
--task.wait(5)
--connection:Disconnect()
--BV:Destroy()
--isActive = false -- Reset the debounce so it can be used again
end
script.Parent.Parent.TextButton.MouseButton1Click:Connect(function()
activate()
end)