Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I fling a player at an angle using this Vector?

I have the below code for flinging the player forward. It works flawlessly. The problem I'm having is now I want to apply an upwards angle so that the player moves forward and upwards when this is applied. How would I go about doing this? Thanks!

local position = Instance.new("BodyVelocity",Player.Character.HumanoidRootPart)
position.MaxForce = Vector3.new(50000,50000,50000)
position.Velocity = Player.Character.HumanoidRootPart.CFrame.lookVector*50

3 comments

0

So you want a sort of arc?

0

Basically

0

I solved the issue, thanks for your interest in helping ffejyos!

1 answer

I fixed my own problem again. lol I probably should just delete the post, but I'd like to post the resolved problem for future reference for others! I just wish I could rank up my own answer as the solution.. Basically, the Y axis was 0 when I applied the change to the lookVector, so when I added 60 to that axis after the change, it pushed me up as well. The following code thrusts the character forward and upward, basically an arc kind of jump.

local position = Instance.new("BodyVelocity",Player.Character.HumanoidRootPart)
position.MaxForce = Vector3.new(50000,50000,50000)
position.Velocity = Player.Character.HumanoidRootPart.CFrame.lookVector*100+Vector3.new(0,60,0)
game.Debris:AddItem(position,1.25)

This discussion is preserved as it was. New answers, comments, and votes are closed.