I want to know how to launch a player up and into the air at a constant rate. I can launch the player into a direction, but launching it into the air works only after the player gets up
local Knockback = Instance.new("VectorForce")
local KnockbackUpForce = Vector3.new(0,1200,0)
local KnockBackForce = 1000
-- The force is where I apply knockback
Knockback.Force = Character.HumanoidRootPart.CFrame.UpVector * KnockbackUpForce + Character.HumanoidRootPart.CFrame.LookVector * KnockBackForce
Knockback.RelativeTo = Enum.ActuatorRelativeTo.World
Knockback.Attachment0 = char.HumanoidRootPart.RootAttachment
Knockback.Attachment1 = Character.HumanoidRootPart.RootAttachment
Knockback.ApplyAtCenterOfMass = true
Knockback.Parent = char.HumanoidRootPart
game:GetService("Debris"):AddItem(Knockback,KnockBackTime)
And it keeps acting like this:
robloxapp-20220723-1432342.wmv (1.8 MB)
Any Feedback would be appreciated!
You should try using :ApplyImpulse
1 Like
try cframing the character.
Character physics are weird, so the best way for the launch to be realistic is if you cframe the character and calculate the gravity to trace a trayectory
trajectory* (Extra wordsasdasf)
to draw it, you can use lookvector and multiply it by the distance you want the knockback to be respective to the energy you apply.
then just divide it by the workspace.gravity (196.1 = 9.81 m/s2)
local distance1 = Character.Head.LookVector * 10 --Studs–
local distance = distance1/9.81
that will be the distance it will be pushed.
Now to calculate the fall:
local energy = 0
energy += 9.81 * 0.1
local CFramee = Character.PrimaryPart.CFrame - Vector3.new(0,energy,0)
i will try this and say wether this works or not
the fall energy is added the workspace.Gravity converted to decimals, that will make the character’s primarypart position y axis to go down
On this sentence:
what is the “m/s2” mean?
It didn’t work thanks for trying!
1 Like
meters/square seconds (Extra words)
This worked for me, thank you!