How to make the Velocity in the direction I face and not the person affected

		Remote.OnServerEvent:Connect(function(Player,Character,NextAnim)
		if NextAnim == 1 then
		 local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
			 local BodyVelocity = Instance.new("BodyVelocity", HumanoidRootPart)
            BodyVelocity.Velocity = Vector3.new(0,10,0) + HumanoidRootPart.CFrame.LookVector *  120
				
					            wait(0.5)

				
			 BodyVelocity:Destroy()

the script in question, for some reason it only sends them in the direction they face, and not the direction im hitting them at. Help appreciated

I’m not sure how to get them to be launched in the direction my character faces and not theres. Please someone help me out cuz im strugglin

So you’re trying it to launch it based on where your character is looking?

1 Like

Use the HumanoidRootPart of the Player

local HumanoidRootPart = Player.Character.HumanoidRootPart

use that HumanoidRootPart,

1 Like

So if I’m not slow, I’m going to guess that you need to use something like displacement. (FinalVector - StartVector). This will get the direction in from the root part to your target.

1 Like

Sorry i forgot to close this I already figured the issue out lol. Appreciate your response tho.
Since you’re here mind helping me out with something in relation to this?

1 Like

Yeah sure go ahead, ask the question

1 Like

Awesome.
So i’m tryna get the person, once they get knocked back to go into a Ragdoll stage for about a second, but I’m finding no success doing it. Heres what I’ve got. change it all up if you think its bad :slight_smile: ty for the help.

Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        local Humanoid = Character:WaitForChild("Humanoid")
						        Humanoid.ChangeState(Enum.HumanoidStateType.Ragdoll)
						wait(1)
						        Humanoid.PlatformStand = true

    end)
end)

This is in a Server script btw incase that matters

So you’re doing this when the character is added. What I think you’re trying to achieve is when the State is changed, then you can do Humanoid.ChangeState(Enum.HumanoidStateType.Ragdoll)

1 Like

ooo alright, how would I do that? Do you want the full script or do you have enough info as is.

So like,

humanoid.StateChanged:Connect(function(oldState, newState)
if newState == Enum.HumanoidStateType.YourState then
Humanoid.ChangeState(Enum.HumanoidStateType.Ragdoll)
wait(1)
Humanoid.PlatformStand = true
end
end)

1 Like

it says
" [YourState is not a valid EnumItem]

Replace “YourState” with whatever state you’re trying to check in order to enable ragdoll

1 Like

Ohhh lol sorry I’m not the brightest.

I dont really know what position they would be in. The knockback throws them up and back a bit so what do you think would work best with it?

You could do this by setting the velocity.

local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
local BodyVelocity = Instance.new("BodyVelocity", HumanoidRootPart)
local Direction = CFrame.new(Player.Character.HumanoidRootPart.Position, HumanoidRootPart.Position)
BodyVelocity.maxForce = Vector3.new(math.huge,math.huge,math.huge)
BodyVelocity.Velocity = Direction.lookVector * 50 --(you could change the values of 50 to match your knockback needs)
1 Like