Unity3D study notes 9 add details for the scenario (2), unity3d Study Notes

Source: Internet
Author: User

Unity3D study notes 9 add details for the scenario (2), unity3d Study Notes
In the previous section, we added the first stone with a collision tool to the scenario. In this section, we use Prefab to add the details of the scenario and improve it. This series of tutorials and materials refer to the translation tutorial "Unity game engine basic getting started video tutorial" produced by the translation team of Renren materials. The download link is attached to the second learning note.
Next to the formed rock Boulder, we can make a lot of stone Prefab, which is very beneficial to enrich our huge scenarios, let's first create the Prefab of the first stone. Press Control + D to copy a stone, hold down the coordinate axis, press R to adjust to the Zoom tool, and hold down the white cube in the center to zoom out the stone.

In Unity3D, the scale of the white cube at the center is scaled evenly, so the rock should be suspended. So press W to return the coordinate tool and adjust its position. Let him overlap with the original stone to a certain extent. At the same time, I individually scaled him on the Y axis to make him look shorter and flat, instead of seeing a small replica of the stone next to him at a glance. Next, copy another stone. You can copy it at will, and then adjust it to a smaller size, so that the three stone heads can be stacked and become a stone stack.


Next we will integrate the stone heap into a Prefab. Now we create a new Prefab In the Prefab folder and name it PFB_Boulder_Cluster. Create a new game object in Hierarchy and name it PFB_Boulder_Cluster. Drag the three stones into the new game object and drag the game object into the new Prefab. You can use this Prefab directly if you want to add a stone heap. If you want to synchronize the minor changes made to one of the Prefab in the scenario to all of the Prefab, and the changes introduced in the future will also happen, you only need to click Apply in the Inspector view, but a slight change will break the original scene harmony. As shown in the following figure, at the corner, I introduced another Prefab and rotated the angle to adjust the ratio, but I didn't Apply it because all the Prefab after the application will become smaller.

Drag the Mesh model Boulder_01 we introduced earlier, and find the material that belongs to him in the Materials and paste it to him. Similarly, add the Mesh Collider to adjust the size, ratio, and angle.


Finally, Beam is introduced into the scenario and pasted with the Beam material. Because the shape is regular, add Box Collider for it. Unity automatically wraps a suitable Collider for us. We want this crossbar to serve as the support for the scenario. So press E to rotate it 90 degrees and let him stand up, wood is much longer than the height of the whole space. You can use the R scaling tool to adjust its length.



The next step is to make the Boulder_01 and Beam that we already have Collider into a Prefab. I believe you are familiar with building a Prefab. With rock heaps, rock blocks, and wooden beams, We can enrich our scenarios to a great extent.

We hope that you can describe the scenes, wood, and stones we have created based on your own needs. In this way, you can put them in places that you think are reasonable and complete the scenes to make our scenes look more complete.


By Mr. Losers




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.