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 » Scripting Helpers
Home Search
 

Re: mouse and BodyPosition

Previous Thread :: Next Thread 
makerror is not online. 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 is not online. 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 is not online. makerror
Joined: 29 Aug 2011
Total Posts: 493
29 Jun 2013 08:43 AM
it nothing changed
Report Abuse
IAmAMelon is not online. 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 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
29 Jun 2013 08:47 AM
Position, not position
Report Abuse
IAmAMelon is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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