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: Region3 not checking

Previous Thread :: Next Thread 
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
21 Jun 2014 09:51 AM
For some reason, my Region3 code doesn't seem to be checking anything. It's not even running the print command for anything it finds. Care to take a look? Of course, the called function is missing, but I already know that the problem seems to be in the checking and not my function.

local spring=script.Parent
local platform=spring.MainSpring.Platform

local Pos1=platform.Position+Vector3.new(2,1,2)
local Pos2=platform.Position+Vector3.new(-2,0.51,-2)
local raaa=Region3.new(Pos1,Pos2)

while wait(.3) do
checkparts=game.Workspace:FindPartsInRegion3(raaa,script.Parent,20)
for i=1,#checkparts do
print("Checking " .. checkparts[i].Name)
bounce(checkparts[i])
end
end

ily bae <33
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
21 Jun 2014 09:57 AM
local spring=script.Parent
local platform=spring.MainSpring.Platform

local Pos1=platform.Position+Vector3.new(2,1,2)
local Pos2=platform.Position+Vector3.new(-2,0.51,-2)
local raaa=Region3.new(Pos1,Pos2)

while wait(.3) do
for _,v in pairs(game.Workspace:FindPartsInRegion3(raa,script.Parent,20) do
print("Checking " .. v.Name)
bounce(v)
end
end

I think that should work.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
21 Jun 2014 09:58 AM
local spring=script.Parent
local platform=spring.MainSpring.Platform

local Pos1=platform.Position+Vector3.new(2,1,2)
local Pos2=platform.Position+Vector3.new(-2,0.51,-2)
local raaa=Region3.new(Pos1,Pos2)

while wait(.3) do
for _,v in pairs(game.Workspace:FindPartsInRegion3(raa,script.Parent,20)) do
print("Checking " .. v.Name)
bounce(v)
end
end


I forgot one of the parenthesis
Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
21 Jun 2014 10:03 AM
for _,v in pairs(game.Workspace:FindPartsInRegion3(raa,spring,20)) do

Argument 1 missing or nil.

ily bae <33
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
21 Jun 2014 10:07 AM
Forgot to put the last a in raaa in that script, sorry about that.
Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
21 Jun 2014 10:13 AM
Same result as before your changes. No script feedback or printing.

ily bae <33
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
21 Jun 2014 10:18 AM
local spring=script.Parent
local platform=spring.MainSpring.Platform

local Pos1=Vector3.new(platform.Position+Vector3.new(2,1,2))
local Pos2=Vector3.new(platform.Position+Vector3.new(-2,0.51,-2))
local raaa=Region3.new(Pos1,Pos2)

while wait(.3) do
for _,v in pairs(game.Workspace:FindPartsInRegion3(raaa,script.Parent,20)) do
print("Checking " .. v.Name)
bounce(v)
end
end

Try that. I'm not too much of an expert in Region3's so I may not be able to help you if that doesn't work.
Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
21 Jun 2014 10:22 AM
Still not working.

I'm thinking that it's an issue with Pos1 and Pos2, but I don't see how. That should be creating a 'hitbox' of sorts that is 4 studs wide and about half a stud tall just above script.MainSpring.Platform, theoretically. So this is quite the head scratcher.

ily bae <33
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
21 Jun 2014 10:30 AM
local spring=script.Parent
local platform=spring.MainSpring.Platform

local Pos1=Vector3.new(platform.Position+Vector3.new(2,1,2))
local Pos2=Vector3.new(platform.Position+Vector3.new(-2,0.51,-2))
local raaa=Region3.new(Pos2,Pos1)

while wait(.3) do
for _,v in pairs(game.Workspace:FindPartsInRegion3(raaa,script.Parent,20)) do
print("Checking " .. v.Name)
bounce(v)
end
end


I found this quote on the wiki and it gave me the idea to switch your vector 3's around. Not sure it will do anything though:

"The first argument is the lower corner of the bounding box, while the second argument is the upper corner. Note that this means the X,Y and Z for the second argument should all be larger than the first one."
Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
21 Jun 2014 10:34 AM
It worked... Though, I don't see why, as it should be able to accept any variables in any order, theoretically.

But that aside, thanks~! Now my spring system can actually function :DD

ily bae <33
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
21 Jun 2014 10:35 AM
No problem! Happy to help :)
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