- Home /
Issue using separate GameObject to detect bounds
I have a script that generates dungeon rooms and connect them to each other based on their door positions - it's finished and works just as intended. One of the variables used is the renderer.bounds of the room object itself (the same object that has the script attached). For development reasons I've created a child GameObject with the same bounds, and I'm trying to refer to that GameObject in the script instead:
Old version: http://pastebin.com/HDgUJgNL
New version: http://pastebin.com/3Gmzst43 (changes highlighted)
However, this makes the room generation behave badly - sometimes the collision detection part seems to malfunction and rooms are created in the same position as each other. I do not understand why this happens, since the bounds themselves are identical (I've checked with Debug.Log()). Is there something I'm doing wrong referring to the new GameObject?
Your answer
Follow this Question
Related Questions
Finding Children question 3 Answers
Very Erratic behavior when parenting an object 0 Answers
change pivot of parent game object 1 Answer
How to enable children of child game object? 1 Answer
Scriptural Child Implementation 2 Answers