Objects lose collision when set as child?
I'm working with procedurally generated dungeons. To keep everything in my hierarchy neat and tidy I want to set every block generated as a child of an emtpy gamte object. When I do this however the characters just fall though when they spawn on the map.
I don't have this problem when I don't set the blocks as children. Any Idea why this happens and how this can be fixed?
Update: I have formulated my question wrong. I checked the objects during runtime and they still have their box colliders but the characters fall through non the less
Good day.
Can you post an image of the inspectors? Where the colliders/rigidbodies are? in each cube, or there is a general colliders/rigidbodiy? Are you using some code like OnCollisionEnter or something like this? Where, which scripts at which objects?
Paste some images of inspectors and code. Thaanks!
@tormentoarmagedoom I've tried to post a reply with images multiple times but it doesn't seem to work so I'll try to post it without images in the hopes it works (and that you don't get overloaded with my previes attempts after I post this).
I'm using the standard objects provided by unity. The dungeon tiles are the standard cube object and the characters are basic capsule objects, both are using their default collider they have when you create a new object.
I don't use a OnCollisionEnter on the character nor the dungeonTile. I do use a script to place dungeon tiles according to a pre-generated array and then set the dungeon$$anonymous$$anager as parent.
The characters come from a different scene and are children of an emtpy object CharacterTeam whithin DontDestroyOnLoad.
Hope it helps a bit :/
@tormentoarmagedoom $$anonymous$$y formulation of the question is off. I have checked the dungeontiles during runtime and found that the tile objects still have their Box collision but the characters fall through none the less.
Your answer
Follow this Question
Related Questions
Child an Object to Another Objects Parent On Collision 1 Answer
Parenting objects with code not working 2 Answers
Instantiating as a child of an object in hierarchy 1 Answer
How do I spawn an array of prefab clones as children of an object? 1 Answer
How to set an object to be a child of another using c# 1 Answer