|
| 29 Aug 2012 11:54 PM |
| Is there a way to make the dragger object only work in a certain area? I've checked the wiki but it doesn't seem to have any properties to do this. So is there a way to do this via scripting? |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2012 12:01 AM |
dragger?
This item is deprecated. Do not use it for new work.
fc |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2012 12:30 AM |
| http://wiki.roblox.com/index.php/Dragger |
|
|
| Report Abuse |
|
|
einsteinK
|
  |
| Joined: 22 May 2011 |
| Total Posts: 1015 |
|
|
| 30 Aug 2012 03:43 AM |
Nope, this isn't deprecated. to be exact, this object is also used in the modern Move Tool in personal servers! (That 2 arrows on each other toolthingy)
Just don't give it a parent, then it errors :D
Well, the dragger is designed, that YOU say how to move! Like:
dragger:MouseMove(RayToWhere)
Just put this in: AreaStart = Vector3.new(-100,0,100) AreaEnd = Vector3.new(100,50,100) pos = GetRayHitPos("You need to make this function,I'm lazy") if pos.x > AreaStart.x or pos.x < AreaEnd.x then return end if pos.y > AreaStart.y or pos.y < AreaEnd.y then return end if pos.z > AreaStart.z or pos.z < AreaEnd.z then return end dragger:MouseMove(...) |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2012 12:32 PM |
| Hmm.. I'll give that a try and see how it goes. |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2012 01:28 PM |
Alright, so I gave it a shot and it didn't work. Here's what i have (this is only a chuck of code from a script):
function getRayHitPos() if mouse == nil then return end local _, rayHitPos = Workspace:FindPartOnRay(mouse.UnitRay, nil, false) return rayHitPos end
function checkRayHitPos(rayHitPos, areaStart, areaEnd) local inBoundaries = true if rayHitPos.X > areaStart.X or rayHitPos.X > areaEnd.X or rayHitPos.Y > areaStart.Y or rayHitPos.Y > areaEnd.Y or rayHitPos.Z > areaStart.Z or rayHitPos.Z > areaEnd.Z then inBoundaries = false end return inBoundaries end
-- this is part of a larger function while wait() do if partDeployed then break end local center = Workspace.WorkshopDetails.Workshops:FindFirstChild(player.Name).Border.Bottom local areaStart = center.Position + Vector3.new(-98.5, 1, -98.5) local areaEnd = center.Position + Vector3.new(98.5, 98, 98.5) local rayHitPos = getRayHitPos() local inBoundaries = checkRayHitPos(rayHitPos, areaStart, areaEnd) if not inBoundaries then dragger:MouseMove(mouse.UnitRay) end end
So the problem I'm having is that the part is still able to be moved outside of the boundaries I want. I have a semi-invisible box around the building area, however if you angle the camera just right near one of the walls, the mouse slips out of the box and drag the part out with it. Am I doing something wrong? |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2012 01:32 PM |
| Derp.. nvm. I realized I did something wrong. |
|
|
| Report Abuse |
|
|