- Home /
Should player & pickups be children of the level, or keep them separate?
This is a question about best-practice rather than anything technical, and the answer might be personal preference.
So I have a level which is one mesh, imported from 3Ds max. I have trigger objects in the level (lets call this "level1"), as well as pickups. I've put these gameobjects as children of level1 because I thought that'd make sense in case I ever needed to move or scale the level. It'd save time having to reposition everything separately.
But I'm having problems with local positions. An example is that Y position of 0 is very different to the global y axis, and it's getting a bit confusing and annoying.
Do you guys add collectable items as children of the level, or keep them separate? Should the player be a child of the level too?
Here's my game, it's 3D but most of the action happens on a 2D plane (although I always use vector3, which might be the cause of my headaches tbh).
Answer by PlanetVaster · Jul 04, 2015 at 05:09 AM
It's all about personal preference, I usually don't have them as children of the level and you said it was causing positioning issues so it's probably best to not have them as children of the level.
Answer by W.Walter · Jul 04, 2015 at 02:20 AM
Best answer: I don't know. - depends on what you think you should do. To simplify your local/global coord headaches, its always a good idea to place any 'heireachy only' game objects at 0,0,0. So whenever your using game objects to organize your level/scene/whatever, put them at the origin (with no rotation, or scale). This stops random rotations, scaling, and position offsets in your scripts and everything else.
Your answer
Follow this Question
Related Questions
What is the best way to make Half - Life or DOOM style levels? 2 Answers
How to transform an empty GameObject that has gameObject children? 1 Answer
Load the Same Level, but Different Configurations? 2 Answers
[UNet] Best practice to cache components in NetworkBehaviour 0 Answers
Making levels ?? 1 Answer