![]() g.transform.position = new Vector3(Random.Range(-10, 10), 0, Random. Vector3 radius = Random.insideUnitSphere * 10 +transform.position ![]() It is sometimes called a collision model, after the C++ object that loads it into the engine, but as far as creating models is concerned, it is a vertex mesh more or less like any other. GameObject g = Instantiate(t.gameObject) A collision mesh is a cheap 3D mesh used by VPhysics. I clone and position each object in a random position within a sphere: foreach(Transform t in transform)įor (int i = 0 i < Random.Range(minOfEach, maxOfEach) i++) I need both so that object falls on top of others but not thru the floor. ![]() What Ive done is have 1 copy of my object in the container empty (with script), then add all these objects to a list while cloning each a random num of times.Įach object has a Box collider and Rigidbody with gravity. Ok, what Im trying to do is make a huge pile of objects, procedurally. If you want it to bounce you have to write the physics code to detect a collision and change the movement or you can do addforce to move the object and it will detect collisions and react automatically. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |