I can't add a velocity to another player

  1. What do you want to achieve? Keep it simple and clear!
    I want to make a force that when you activate it, it makes the player go in the air and then push back.

  2. What is the issue? Include screenshots / videos if possible!
    The issue is that I can push backwars NPCs, but not Players, also trying the player to look at the person who activated the force.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried to do CFrame and BodyGyro to get the player to look at the player who is activating the force, but I didn’t get any consistant result. On the player that doesn’t move backwards, I don’t really know why. It is in a Server Script, activated by a RemoteEvent.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
https://gyazo.com/5e4bed360c96bcad2f1f4ae23aa629f9
This is the effect I have now on NPCs and CFrame to make it look at me.

https://gyazo.com/381cbcb5a8c71a70f5377dc74beae175
This is the effect on players.

https://gyazo.com/077c3fbce3b863dca1524bd54b7e8c9c
This is kinda what I want (but faster). When I get the NPCs, they move backwards looking at me.

game.ReplicatedStorage:FindFirstChild("Forces").Push.OnServerEvent:Connect(function(Player, Humanoid)
	Humanoid.Health = Humanoid.Health - 1
	local PlayerHit = game.Players:GetPlayerFromCharacter(Humanoid.Parent)
	local HumanoidRootPart = Humanoid.Parent.HumanoidRootPart
	local CharacterHit = Humanoid.Parent
	Humanoid.JumpPower = 60
	Humanoid.Jump = true
	wait(0.1)
	Humanoid.Parent.UpperTorso.Velocity = (Player.Character.HumanoidRootPart.CFrame.lookVector) *  200
	wait(0.2)
end)

(The code is very bad optimized but it’s just a fast thing that works now)
This is the code without the CFrame (removed it as it doesn’t do anything good).

Thanks for reading!

Player humanoids have custom code running that effects the physics of the HumanoidRootPart and it’s movement.

You can temporarily disable this by setting PlatformStand = true for the humanoid, or I believe there is a “RunningNoPhysics” state you can set the Humanoid too.
See: Humanoid | Documentation - Roblox Creator Hub

In general, I would recommend a BodyForce or a BodyVelocity instead of directly setting the velocity of parts inside of the humanoid, and when adding these, parent them on the PrimaryPart of the Character (usually “HumanoidRootPart”, not UpperTorso)

It’s very insteresting all of that, but I don’t see where it can help me :sweat_smile:

game.ReplicatedStorage:FindFirstChild("Forces").Push.OnServerEvent:Connect(function(Player, Humanoid)
	Humanoid.Health = Humanoid.Health - 1
	local PlayerHit = game.Players:GetPlayerFromCharacter(Humanoid.Parent)
	local HumanoidRootPart = Humanoid.Parent.HumanoidRootPart
	local CharacterHit = Humanoid.Parent
	Humanoid.JumpPower = 60
	Humanoid.Jump = true
    Humanoid.PlatformStand = true  --Add this
	wait(0.1)
	Humanoid.Parent.UpperTorso.Velocity = (Player.Character.HumanoidRootPart.CFrame.lookVector) *  200
	wait(0.2)
    wait(3) -- give the player some time to actually be moved to somewhere
    Humanoid.PlatformStand = false
end)

You didn’t understand; my problem is that the velocity doesn’t affect the player server-side, when it should (as the script is a serverscript).

This is what happens when I use the force on NPCs: https://gyazo.com/5e4bed360c96bcad2f1f4ae23aa629f9

And this is what happens when I use the force on Players:
https://gyazo.com/381cbcb5a8c71a70f5377dc74beae175

It’s the same script and it doesn’t affect the players

Bump, still need help !! ^^
Bump, still need help !! ^^

I got the solution. I just needed to use > RunService.Heartbeat:Wait()

Thanks for everyone who came across this post and specially to this post!