How to make a projectile's motion concave upwards?
Asked by
6 years ago Edited 6 years ago
Its hard to explain as im rusty in algebra, but i got this script where it has a projectile move in a curved slope (from your humanoidrootpart to your mouses position) and it has a negative acceleration (where it concaves down).
01 | local p = game.Players.LocalPlayer |
03 | repeat wait() until p.Character |
07 | local hrp = c:WaitForChild( "HumanoidRootPart" ); |
08 | local bball = workspace.Hm; |
10 | m.Button 1 Down:Connect( function () |
11 | local g = Vector 3. new( 0 , -game.Workspace.Gravity, 0 ); |
12 | local x 0 = hrp.CFrame * Vector 3. new( 0 , 2 , - 2 ) |
15 | local v 0 = (mp - x 0 - 0.5 *g*t*t)/ 1 ; |
18 | local c = bball:Clone(); |
21 | c.CFrame = CFrame.new(x 0 ); |
22 | c.Parent = game.Workspace; |
What i am trying to do though, is make the slope has a postive acceleration, so that the slope's curve concaves upwards instead, starting as a decreasing slope and ending as an increasing slope when it reaches the destination..
Kinda like this:
https://gyazo.com/48e64596375a2505968596c03583230c?token=417006b3cc7e1465d476fc20ae150d70
I have tried doing things, like setting the Gravity value to positive, and messing with the numbers and making them negatives/positives, higher/lower, etc. The closest i have gotten was setting the gravity to positive and making the destination 15 units higher, but the part just concaves downwards and does not appear again.
Anything will help!
Thanks!