So, I want do a fly knockback. But i don’t know how to it smooth
-
What do you want to achieve? Keep it simple and clear!
I want do a knockback like this video - What is the issue? Include screenshots / videos if possible!
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to do, but the effects is not smooth
KnockBack.MediumFly= function(player,enemyplayer)
if not player or not enemyplayer then return print("Player1 or Player2 not found.") end
local EnemyVelocity = KnockBack.CreateBodyMover("1",H.PlayerPrimary(enemyplayer))
local Direction = Vector3.new(H.Look(player).X,1,H.Look(player).Z) * 30
EnemyVelocity.Velocity = Direction
wait(1.5)
TweenService:Create(
EnemyVelocity,
TweenInfo.new(1.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),
{Velocity = Direction - Vector3.new(0,60,0)}
):Play()
return {EnemyVelocity}
end
CreateBodyMove is a function to create a body mover ->-
KnockBack.CreateBodyMover = function(movertype,parent)
if movertype == "1" then
local BodyV = Instance.new("BodyVelocity",parent)
BodyV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
return BodyV
elseif movertype == "2" then
local BodyP = Instance.new("BodyPosition",parent)
return BodyP
end
end