|
| 15 Aug 2015 10:31 PM |
| How do you make a tool follow the mouse? |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Aug 2015 11:25 PM |
bodyvelocity? bodyforce? bodygyro? bodyposition? |
|
|
| Report Abuse |
|
|
71428
|
  |
| Joined: 06 Aug 2015 |
| Total Posts: 339 |
|
|
| 15 Aug 2015 11:25 PM |
| Mouse position combined with BodyPosition and BodyGyro |
|
|
| Report Abuse |
|
|
|
| 15 Aug 2015 11:45 PM |
| How do I get the MousePosition? |
|
|
| Report Abuse |
|
|
71428
|
  |
| Joined: 06 Aug 2015 |
| Total Posts: 339 |
|
|
| 15 Aug 2015 11:56 PM |
local mouse = Player:GetMouse() mouse.Hit --The position which is a CFrame value |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 12:28 AM |
So? Something like this:
while true do wait() Tool.Handle.BodyGyro.cframe = CFrame.new(Tool.Handle.Position, mouse.hit) end
Only problem is it tells me: Vector3 Expected, Got CFrame. Then when I switch it it says CFrame expected, Got Vector3 |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 12:29 AM |
| I also don't see were the BodyPosition comes into this? |
|
|
| Report Abuse |
|
|
71428
|
  |
| Joined: 06 Aug 2015 |
| Total Posts: 339 |
|
|
| 16 Aug 2015 12:30 AM |
while true do wait() Tool.Handle.BodyGyro.cframe = CFrame.new(Tool.Handle.Position, mouse.Hit.p) end |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 12:30 AM |
| BodyPosition would be a smooth slide (like a tween), but setting cframe/vector3 is an immediate change |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 12:35 AM |
| Ok, now I have the difficulty of the player moving with the mouse. How can I make only the tool part move instead of the whole player? |
|
|
| Report Abuse |
|
|
71428
|
  |
| Joined: 06 Aug 2015 |
| Total Posts: 339 |
|
|
| 16 Aug 2015 12:36 AM |
| If the tool is welded to the player it will move the player with it. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 12:37 AM |
| Tools are welded to the player so you have to make the part that you want to tween to the mouse separate from the tool or not welded to the player |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2015 12:38 AM |
| And how do you unweld a part from the player? Also, if its unwelded won't it just fall to the ground? |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 12:39 AM |
you unweld by not putting a weld script in the first place
and yes, unachored and unwelding makes the brick fall |
|
|
| Report Abuse |
|
|
71428
|
  |
| Joined: 06 Aug 2015 |
| Total Posts: 339 |
|
|
| 16 Aug 2015 12:40 AM |
Assuming the script is placed inside the tool you can just do something like; local weld = script.Parent:FindFirstChild("Weld") if weld ~= nil then weld:Destroy() end
"Also, if its unwelded won't it just fall to the ground?" That's where BodyPosition comes in. You can place one inside the tool to keep it floating at whatever position you want. BodyGyro is used to just point the object in a certain direction. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 12:58 AM |
| Now the hands just float and fling around(even when positioned), not directly ahead of the player |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 01:08 AM |
| Im wanting them to move around up and down in direction with the mouse, not side to side. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 01:09 AM |
You said a tool that follows mouse not hands that follow mouse those are two completely different things that are scripted completely different |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 01:09 AM |
| Oh... Sorry, thought they were directly related. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 01:10 AM |
| If this helps, the object is a gun. Im trying to allow it to move up and down when in first person. (following were the mouse is) |
|
|
| Report Abuse |
|
|