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.
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.
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.
(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).
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)
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)