Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there A way to create trajectory values for a Basketball?

Asked by 6 years ago
Edited 6 years ago

I have been trying to use bodyvelocity to attempt to shoot the Basketball in the hoop and ive gotten no such luck What im trying to do is after the player has shot the ball I already made it to where I can determine a good percentage and a bad percentage of the shot you took now the only problem is that I am having SERIOUS trouble trying to understand trajectory from the basketball to the hoop --Note basketball is in my (RIGHT HAND)

--Here is the script involving bodyvelocity--(Does not travel to the hoop but does look natural and blends with roblox's physics)

local ball = script.Parent
local BBV = Instance.new("BodyVelocity", ball)
BBV.MaxForce = Vector3.new(0,goal.CFrame,0)
BBV.P = 2000

--NOTE I AM AWARE THIS DOES NOT GO TO THE HOOP I WAS JUST AT A LOSS OF WHAT TO DO SO I DECIDED TO USE ROCKETPROPULSION

--After I got frustrated I tried using RocketPropulsion/ this takes me to the hoop but it doesn't look like it blends with roblox's natural physics so note (This goes into the hoop but it just travels to the hoop as if it were a heat seeking missle)

local goal = workspace.NetOne.Scorer
local ball = script.Parent
local BV = Instance.new("RocketPropulsion", ball)
 BV.Target = goal
 BV.CartoonFactor = 0
BV.TargetRadius = 1
BV.ThrustP = 7
 BV.MaxTorque = Vector3.new(0,0,0)
 BV:Fire()

Im somewhat at a loss here help will be appreciated thanks!

0
If you want me to further explain please let me know because I think i explained this pretty badly Cmonlol135 5 — 6y
0
Could you show us the fire script, so we can help you because I feel like that is the root of the problem. IFeelLikeAGucciAdlib -2 — 6y
0
It isn't the fire script that only determines the percentage of the shot I need to add the velocity that directs the basketball to the hoop through trajectory. Cmonlol135 5 — 6y
0
It sounds like you want to do some projectile trajectory calculations. Have a look at this: https://scriptinghelpers.org/questions/50122/how-would-i-go-about-predicting-where-an-object-would-land#50005 fredfishy 833 — 6y
0
Oh my god FRED THANK YOU if you post that link as an answer i will accept Cmonlol135 5 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You can use ray reflections to make your basketball bounce, but it wouldn't look too realistic. It's not too hard to edit it, though. ROBLOX Wiki made a page about it.

0
Make my basketball bounce? I already know how to make it bounce Im learning how can I shoot the ball through trajectory values not how to make it bounce Cmonlol135 5 — 6y
Ad

Answer this question