#SOLVED

1 messages · Page 1 of 1 (latest)

silent pecan
#

I made a knockback script when the enemy gets hit. but when i hit them sometimes they get knocked towards me and sometimes its away from me

hazy mirageBOT
#

studio** You are now Level 10! **studio

silent pecan
#
    local airvel = 0
    if Air >= 1 then
        airvel = Vector3.new(0,Air,0)
_G.Ragdoll(Victum,5)
    end
    local velocity = Instance.new("LinearVelocity",Victum.HumanoidRootPart)
    velocity.MaxForce = math.huge
    velocity.Attachment0 = Victum.HumanoidRootPart.RootAttachment
    print(Victum.HumanoidRootPart.CFrame.LookVector)
    velocity.VectorVelocity = Player.Character.HumanoidRootPart.CFrame.LookVector * Amount + airvel
    velocity.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
    game.Debris:AddItem(velocity,.4)
end```
kindred bobcat
#

velocity.RelativeTo = Enum.ActuatorRelativeTo.Attachment0

#

this is the problem

#

change your script and do:
velocity.RelativeTo = Enum.ActuatorRelativeTo.World

silent pecan
#

ahhh

#

i see

#

because the attachment rotates because of the ragdoll

kindred bobcat
#

ye

silent pecan
#

Thanks for help brochacco