How do you make objects solid?

I’ve been trying for weeks now to figure out how to make terrain trees and objects you import from Google Sketchup solid so that you can’t pass through them. I’ve seen other posts saying you have to use prefabs and colliders,but i don’t know how to work those very well. If anyone could help it would be very much appreciated.

The most common problem beginners face with collision is that they tend to move their objects through the Transform component using Translate() or the position property - these do not trigger Unity’s collision detection routine.

To make it work, both objects need a Collider components (Cube, Sphere, Capsule, CharacterController, Wheel, Mesh) AND they should only move using the functions from the CharacterController or a Rigidbody and physics force.

Your question sounds like you’re not sure how to use components though, you should probably take a look at the User Manual and the Reference Manual, you might need to get more familiar with the interface and unity’s basic concepts.

The method I use is as follows

To create a prefab simply right click on the folder in your project view where you would like it to live (dont worry you can move it around later) select Create >> Prefab

This will make an empty Prefab “GameObject” and you can add various componets to it including your mesh, scripts etc. this can be done by dragging and droping or by having the object selected and clicking the “Component” menue at the top of the screen the main ones your looking for are under Physics, choose either CharacterController or Rigidbody
3221-clip2.png

Once you have that added to your object you should be good to go, you may want to adjust some settings such as Use Gravity, Mass, etc. depending on what your trying to get done you will also use theses to manipulate your objects in the game world i.e. in a script assoceated with the object you may call somthing similar to

rigidbody.AddRelativeForce (forwardDirection * thrust * Time.deltaTime, ForceMode.VelocityChange);

There are a battery of tutorieals that demonstrate this in much more detail than I can here

2D tutorial (How to make a game in Unity3D) was useful for me but I am focus on 2D development at the moment.

I found a simple solution to this answer. I am a beginner and just started the basics, hope we are on the same boat. Select the object you want to make solid and click “Add Component” then go to physics>mesh collider> check convex and add a material and mesh . This should do the trick.