generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: i have this script

Previous Thread :: Next Thread 
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Aug 2016 11:25 PM
that shoots a ball to the hoop position
anyway to calculate how much velocity u need from ur position to the hoop

this line --Tool.Handle.Velocity = (shootTowards * 75)+Vector3.new(0, 80, 0)


local Tool = script.Parent
local Character = Tool.Parent
local Player = game.Players:playerFromCharacter(Character)
local spawnPos = Character.PrimaryPart.Position
local character = Tool.Parent
local humanoid = character.Humanoid
local target = workspace.hoop.Position
local shootTowards = (target - character.Head.Position).unit
spawnPos = spawnPos + (shootTowards * 5)
wait()
Tool.Parent = game.Workspace
Tool.Handle.Position = spawnPos
Tool.Handle.Velocity = (shootTowards * 75)+Vector3.new(0, 80, 0)


Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
16 Aug 2016 11:26 PM
use (distance*velocity)/drag
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Aug 2016 11:30 PM
i dont understand


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Aug 2016 11:34 PM
isnt that what im doing


local target = workspace.hoop.Position
local shootTowards = (target - character.Head.Position).unit
(shootTowards * 75)

what is /drag


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Aug 2016 11:41 PM
bump


Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
16 Aug 2016 11:42 PM
Unit = direction (Vector3)
Magnitude = distance (float)
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Aug 2016 11:49 PM
ok i did this


local shootTowards = (target - character.Head.Position).unit
local velocity = (target - character.Head.Position).magnitude
Tool.Handle.Velocity = (shootTowards * velocity)+Vector3.new(0, 80, 0)

when faraway it lands about 3 studs infront of it

when close it works pretty good


Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
16 Aug 2016 11:50 PM
then you might want to subtract something like distance/20

small number but will help
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Aug 2016 11:56 PM
thx for ur help

kinda got it goin


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image