TheMesgi
|
  |
| Joined: 03 Mar 2012 |
| Total Posts: 360 |
|
|
| 12 Jul 2016 02:17 AM |
So the script is supposed to propel a ball in the direction you click, but for some reason, it adds the BodyPosition and doesn't set any properties here is the part of the script
mouse.Button1Down:connect(function() local position = mouse.Hit local vev = Instance.new("BodyPosition") vev.Parent = ball vev.D = 0 local distance = (ball.Position - position).magnitude vev.P = distance*10000 vev.MaxForce = Vector3.new(vev.P/20, vev.P/20, vev.P/20) wait(0.1) vev:Destroy() end)
|
|
|
| Report Abuse |
|
|
|
| 12 Jul 2016 02:20 AM |
Setting properties for things like this is kind of weird, you have to set it in lower case, so:
mouse.Button1Down:connect(function() local position = mouse.Hit local vev = Instance.new("BodyPosition") vev.Parent = ball vev.D = 0 local distance = (ball.Position - position).magnitude vev.P = distance*10000 vev.maxforce = Vector3.new(vev.P/20, vev.P/20, vev.P/20) wait(0.1) vev:Destroy() end) |
|
|
| Report Abuse |
|
|
TheMesgi
|
  |
| Joined: 03 Mar 2012 |
| Total Posts: 360 |
|
|
| 12 Jul 2016 02:29 AM |
| yours didn't work either and i couldn't see any changes, did you type it right? |
|
|
| Report Abuse |
|
|
TheMesgi
|
  |
| Joined: 03 Mar 2012 |
| Total Posts: 360 |
|
|
| 12 Jul 2016 02:48 AM |
yeah the one you posted is exactly the same
|
|
|
| Report Abuse |
|
|
|
| 12 Jul 2016 03:59 AM |
No.
vev.MaxForce = Vector3.new(vev.P/20, vev.P/20, vev.P/20)
went to...
vev.maxforce = Vector3.new(vev.P/20, vev.P/20, vev.P/20) |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 12 Jul 2016 05:37 AM |
| "maxforce" needs to be MaxForce. Its a property. You need to spell it the way roblox does. |
|
|
| Report Abuse |
|
|
|
| 12 Jul 2016 07:52 AM |
The problem might be that here: (ball.Position - position).magnitude You're subtracting a CFrame(position), from a Vector3(ball.Position). Change this line local position = mouse.Hit to local position = mouse.Hit.p
Adding .p to a CFrame get's the first 3 components of it as a V3. |
|
|
| Report Abuse |
|
|
|
| 12 Jul 2016 07:52 AM |
| And ya, ignore graphics. Properties always need to have proper capitalization. |
|
|
| Report Abuse |
|
|