How do I make a player shoot into the air temporarily?

Hello, I am trying to shoot a player into the air a set distance for a game I am currently developing. What makes this tricky, is the fact that players will be different sizes, with some being super large. Jumping is disabled, so that affects any attempts to use a forced jump.

I have tried using force jump without much success. Body movers seem like the best choice, however I have been unable to implement them successfully and the fact that players can be different weights means that it will be trickier to make every player shoot up the same distance.

This is my current code. It is super glitchy and it doesn’t allow the player to move as they are flying through the air. I don’t think tweening is the way to go…

--make player fly up
local newPos = hum.Parent.HumanoidRootPart.Position + Vector3.new(0, gameSettings.JumpHeight, 0)
local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local part = hum.Parent.HumanoidRootPart
local goal = {Position = newPos}
local tween = tweenService:Create(part, tweenInfo, goal)

tween:Play()

Any suggestions on how to to this? Thanks!

1 Like

Just insert a body position into the humanoidrootpart, and tween the bodyposition’s position. Then set the max force to (inf, inf, inf).

The issue with tweening is, you can’t move, it’s just a straight up and down. Unless I can tween just the Y direction or something, I don’t think this would work.

You can use BodyForce or just set the Velocity of the player’s rootpart to like Vector3.new(0, 5000, 0) or rootpart.Velocity = rootpart.Velocity + Vector3.new(0, 5000, 0)

1 Like