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
 

Dragger Boundaries

Previous Thread :: Next Thread 
silverfire17 is not online. silverfire17
Joined: 28 Jan 2012
Total Posts: 42
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
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
30 Aug 2012 12:01 AM
dragger?

This item is deprecated. Do not use it for new work.

fc
Report Abuse
silverfire17 is not online. silverfire17
Joined: 28 Jan 2012
Total Posts: 42
30 Aug 2012 12:30 AM
http://wiki.roblox.com/index.php/Dragger
Report Abuse
einsteinK is not online. 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
silverfire17 is not online. silverfire17
Joined: 28 Jan 2012
Total Posts: 42
30 Aug 2012 12:32 PM
Hmm.. I'll give that a try and see how it goes.
Report Abuse
silverfire17 is not online. silverfire17
Joined: 28 Jan 2012
Total Posts: 42
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
silverfire17 is not online. silverfire17
Joined: 28 Jan 2012
Total Posts: 42
30 Aug 2012 01:32 PM
Derp.. nvm. I realized I did something wrong.
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