Unity3d - Create new gameobject from existing objects in unity - unity3d

I am beginner in Unity3d. i would like to ask you about creating new gameobject from exsiting objects in unity3d.
I want to to create new gameobject from existing spheres and squares in unity3d. Right now, i only drag them to become a group. In addition, I want spheres and squares in the new gameobject not to effect collider together.
The new object only collide with other outside objects. How i can do it?
More a question, i would like to create a hoop object in Unity3D, Has already hoop object existed in Unity3D? It has not existed yet, please tell me how to create it? and the space is at middle of hoop not to effect collider ??? Thanks so much,
If my question is not easy to understand, i will edit.

Sounds like you're after a Prefab.
Once you've created your prefab, you might want to Instantiate it.
To avoid collisions, make sure your prefab does not have a Collider component. Simply remove the component inside the prefab.
A hoop shape is also known as a taurus or a donut. This isn't available as a primitive in Unity3D but it is very easily created in 3D modelling programs and used within Unity3D's mesh import.

As Nathan pointed out, create a prefab from your objects.
It looks like you want your objects to act like a compound collider (see Compound Colliders section here). You need your objects to have Collider components, and you need to add RigidBody component to their parent GameObject.
About torus collider: http://forum.unity3d.com/threads/27906-Adding-a-new-collider-primitive

Related

Unity prefabs importing without a colliders

In my project, I have imported around 15 assets, but none of them have a collider, which would allow me to walk through the prefab (the whole house).
walking through the house
Would someone be able to assist me in fixing this? Is there anything I am doing wrong, or what am I doing wrong?
It was very difficult for me to find any prefabs with normal colliders, but I was able to find some fence prefabs.
You can add a mesh collider to whatever objects have a mesh renderer component attached, and it should automatically generate it.
https://docs.unity3d.com/Manual/class-MeshCollider.html

How can i add a collider for the elevator to prevent from the character to walk through the object?

The character can enter the elevator but the problem is that he can also walk through the walls from sides and behind.
And if i add a box collider or any other collider/s they will prevent from the character to enter the elevator. It's not my elevator object it was made in blender.
Use Compound Collider instead of Mesh Collider.
Create new empty GameObjects called back, front, right, left, top and bottom
then attach Box Collider to each one. Manually resize and move each one to match the size of the elevator on all sides.
Once that is done, put them in a parent empty GameObject then put that parent GameObject under your elevator GameObject so that the colliders will move/rotate with the elevator. Finally, disable or move the front Collider GameObject via code when you want to allow the player to enter inside the elevator.
The image below shows example of what individual collider should look like and the final look:
These sorts of questions are better off in the Unity Answers, as this isn't a programming question. Please keep that in mind for future questions.
To answer your question though,
Find the mesh in your Project Files in Unity, there is a checkbox for 'Generate Colliders' - check this box and press apply.
Finally, on the GameObject with the mesh, add a MeshCollider component.
If the model is set up correctly, your mesh collider should now use the model for collision.
If this does not work, as an alternative, you can use cubes with colliders and 'build' the collision mesh yourself, and parent the objects to the same object so they move with the lift, before disabling the MeshRenderer component so they will not render.

Will a raycast or collider detect an unrendered mesh in Unity3D?

I have a 3d object (a capsule) that I'm using in lieu of a character model because the project is going to be from a first person perspective. You can choose in the inspector whether to render the object's mesh or not. Since this object is meant to be invisible and only a hitbox, I want to know if raycasts and colliders will still detect it. I'm assuming yes because the object seems to behave normally with the physics, but I want to avoid complications in the future.
The only thing that matters for physics is the colliders and rigidbodies, It doesn't care about meshrenderers

Primitive colliders on complex model in Unity

I just imported my tree model from blender and i want to add colliders to it. It has animation attached to it(tree is breaking and falling). I have read about adding colliders to animated objectsand from what I understood I just have to add many primitive colliders to different bones. My problem is that I can't rotate this primitive colliders and i cant make them fit shape of the object. Is there any better way to do this?
You could create an empty gameobject under the bone and add the collider onto that. The colliders rotation follows the rotation of the gameobject it was added to.

After importing .fbx model to Unity it is possible to go through it

I have some models created in makehuman and edited in blender. I export them in fbx and import into unity, but when i put "generate collider" it doen't do anything. I find a solution in adding to a model new collider (capsule for example), but it seems to me that it is really a wrong way to do it
When you use Generate Collider you are actually creating a mesh collider.
When you enable Generate Colliders in the Import Settings, a Mesh
collider is automatically added when the mesh is added to the Scene.
It will be considered solid as far as the physics system is concerned.
Colliders information.
This means that now you have a collider which takes the form of the mesh and you can either re-add the model to the scene so that it contains this mesh collider or you can add it via the Components tab.
You also need to make sure that your new mesh collider can actually collide against other objects. Check what you need to make collisions happen via this table:
Also it is important to note that using primitives instead of mesh colliders is often preferable due to its performance advantages. An example below on how to avoid using mesh colliders: