makerror
|
  |
| Joined: 29 Aug 2011 |
| Total Posts: 493 |
|
|
| 29 Jun 2013 08:31 AM |
-- This is not all script pos = Instance.new("BodyPosition",char.MarbleBall) pos.maxForce = Vector3.new(math.huge,math.huge,math.huge) pos.P = 400 pos.D = 400 pos.position = marble.Position -- MarbleBall is a marble debounce = false mouse.Move:connect(function() pos.position = CFrame.new(mouse.Hit.p) char.Humanoid.Sit = true end) end)
I made a ball welded to character and I want make that ball move to where mouse is but it's not working. Problem is somewhere at 'mouse.Move....'
Can anyone help me to solve it? |
|
|
| Report Abuse |
|
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 08:34 AM |
position takes a Vector3.
pos.position = Vector3.new(mouse.Hit.p) |
|
|
| Report Abuse |
|
|
makerror
|
  |
| Joined: 29 Aug 2011 |
| Total Posts: 493 |
|
| |
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 08:44 AM |
Ah, sorry. mouse.Hit.p is already a Vector 3. It'd just be:
pos.position = mouse.Hit.p |
|
|
| Report Abuse |
|
|
getkoed2
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 1144 |
|
| |
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 08:51 AM |
| No, a bodyposition has the property "position", NOT Position. |
|
|
| Report Abuse |
|
|
makerror
|
  |
| Joined: 29 Aug 2011 |
| Total Posts: 493 |
|
|
| 29 Jun 2013 09:05 AM |
@IAmAMelon yes,it have to be position
maybe it's because I can still walk with my character? How i can disable all character controls? |
|
|
| Report Abuse |
|
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 09:10 AM |
The ControllerService
service = game:GetService("ControllerService")
for k,v in pairs(service:GetChildren()) do if v:IsA("HumanoidController") then v:Destroy() end end
Then, to give control back, do this:
Instance.new("HumanoidController", service)
|
|
|
| Report Abuse |
|
|
makerror
|
  |
| Joined: 29 Aug 2011 |
| Total Posts: 493 |
|
|
| 29 Jun 2013 09:19 AM |
Thanks made it like this now
mouse.Button1Down:connect(function() pos.maxForce = Vector3.new(0,0,0) pos.P = 1000 pos.D = 1000 pos.position = mouse.Hit.p
the problem is ball always moving to 0,0,0 coordinates, mouse clicking wont work
|
|
|
| Report Abuse |
|
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 09:21 AM |
You need to set the maxForce to something large,
pos.maxForce = Vector3.new(100000, 100000, 100000)
When it's at 0 it won't do anything. |
|
|
| Report Abuse |
|
|
makerror
|
  |
| Joined: 29 Aug 2011 |
| Total Posts: 493 |
|
|
| 29 Jun 2013 09:30 AM |
| still not working, but i can control marble with command bar. Something wrong with mouse |
|
|
| Report Abuse |
|
|