#Epic bezier smoothness fail
78 messages · Page 1 of 1 (latest)
local function TweenArm(arm)
spawn(function()
local armStartCf = arm.CFrame
local timeElapsed = 0
local rnd = Random.new()
local rndCF = CFrame.new(rnd:NextInteger(-7,7),rnd:NextNumber(-6.5,6.5),rnd:NextNumber(-3,7.5))
local speed = script.Parent:GetAttribute("speed")
local duration = (armStartCf.p - pivotCFrame.Position).Magnitude / speed
local tweenDelay = 0.1
timeElapsed = 0
while timeElapsed < duration do
local progress = timeElapsed / duration
local pointAtTimeElapsed = Bezier_Module:QuadraticBezier(progress,armStartCf.p,(armStartCf * rndCF).p, pivotCFrame.p)
local lookAt = Bezier_Module:QuadraticBezier(progress+0.01,armStartCf.p,(armStartCf * rndCF).p, pivotCFrame.p)
if timeElapsed == 0 then
arm.CFrame = CFrame.new(pointAtTimeElapsed,Bezier_Module:QuadraticBezier(progress+.01,armStartCf.p,(armStartCf * rndCF).p, pivotCFrame.p))
elseif timeElapsed == speed then
local tween = TweenService:Create(arm,TweenInfo.new(.4),{Transparency = 1}):Play()
end
timeElapsed += speed
local tween = TweenService:Create(arm,TweenInfo.new(tweenDelay,Enum.EasingStyle.Quad),{CFrame = CFrame.new(pointAtTimeElapsed,lookAt)})
tween:Play()
game:GetService("TweenService"):Create(arm,TweenInfo.new(duration,Enum.EasingStyle.Quad),{Transparency = 1}):Play()
task.wait(tweenDelay*0.95)
end
task.wait(.5)
arm:Destroy()
end)
end
while task.wait() do
local arm = game.ReplicatedStorage.Arm:Clone()
local Hitbox = V4.new(arm)
Hitbox:SetPoints(arm, {Vector3.new(0, 0, 0), Vector3.new(-0.5, 0, 0), Vector3.new(0.5, 0, 0), Vector3.new(0, 1, 0), Vector3.new(-0.5, 1, 0), Vector3.new(0.5, 1, 0), Vector3.new(0, -1, 0), Vector3.new(-0.5, -1, 0), Vector3.new(0.5, -1, 0)})
Hitbox:HitStart()
Hitbox.Visualizer = false
arm.Position = script.Parent.Position
arm.Parent = script.Parent
pivotCFrame = CFrame.new(script.Parent.Attachment.WorldPosition)
TweenArm(arm)
Hitbox.OnHit:Connect(function(hit, humanoid)
if humanoid and humanoid ~= Human then
local Damage = math.random(.5,1)
humanoid:TakeDamage(Damage)
end
end)
task.wait(.6)
end
Link if you want to see how it looks
no fuck you grunk
Add debug prints
it's not smooth
😱
Insane!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Yeah, my professional opinion is that this code looks doo doo ass
oo no
S1 on top
Apply for S2
Do you still need help
Yeah
What is the problem exactly
See??
set network owner to the player
actually no
do it on the client
instead of the server
Whats the difference
Okay, it doesn't look choppy to me but here are some ways you can improve it. First thing is to use the task library for your spawn it will make more of them. Second thing is to use delta time, multiplying by the time since the last wait will make it linked to the rate between movements making it appear smoother. task.wait returns the delta time value.
Oh
It's on server?
yes
Yeah definitely never put your effects on the server.
I know
I was just testing it
if i can achieve a similar effect
and then I looked at it, and it didn't look as i wanted
just do it on client, problem solved
Doing it on the client will make it so it doesn't have to replicate and the delay will be more consistent making it appear more smooth. You can also tie it to renderstepped and use deltatime to tie it to the render rate making it actually smooth.
^
Thanks for the help.
if this is solved please close ur post
No
Right, that's why you're S1
That's a video
Makes sense
indeed
Close the thread if you've solved it
i just said that
I said it better though
Working on it
