|
| 01 Mar 2015 10:52 AM |
I'm making a game and this is where I check the placement, it keeps saying that my model is.. "Inside Object: Part Walls" The thing is that walls is a model that surrounds me, Its all one big model that is yes walls, and yes it surrounds me, and I have no idea why it does this.
local region=Region3.new(position-size*.4,position+size*.4) local parts=workspace:FindPartsInRegion3WithIgnoreList(region,newUnit:GetChildren(),100) for _,v in pairs(parts)do print('Inside object: '..v.Name..' '..v.Parent.Name) return nil end |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 10:53 AM |
| Also I used a loop to check parts so I can get the name |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:00 AM |
| If you want to know why it prints that, it is because parts is a table containing the instances. Also why is there a return statement? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:03 AM |
| Sorry if I answered your question wrong because I didn't quite understand what you were looking for. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:03 AM |
| Lol, putting a return right there will end the loop. So you might as well just remove the loop if you don't want it to loop. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:06 AM |
| Its a function, and I want it to return nothing if it finds a part. The goal is to make a placement system. I would have guessed you knew that from my "I'm making a game and this is where I check the placement," |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:08 AM |
Here's my full code in case you want to so it, but be warned, it looks horrible.
http://codepad.org/zs22BHX4 |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:08 AM |
| So it's working as expected? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:08 AM |
| No its not, it keeps saying the part is inside the wall, when Its not even near the wall |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:11 AM |
How many parts are inside the Walls model? Try deleting some and see if it works correctly |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:13 AM |
| The wall model has like 16 parts. I move the model up and I can place it |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:15 AM |
print(#parts)
how many is there? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:19 AM |
| 17, but the basepalte is in it too, and its named baseplate, so only 16 walls |
|
|
| Report Abuse |
|
|
| |
|