Beginner’s Unity Development Study Notes----First Day

The following is my experience in learning unity knowledge. It is similar to a memo. There must be loopholes or inappropriate use of professional terms. . .

Goal: Write the effect of the ball wasd movement


1. Download unity hub and unity engine:

(1). Go to the official website: Unity real-time content development platform - real-time 3D engine, 2D, VR & AR visualization data | Unity China official website

(2).Select the unity tab and choose to download unityhub

(3). After downloading and installing unityhub, you can download it directly in the hub, or you can download the unity engine from the official website and introduce it in the hub.

Problems encountered and solutions:

Problem 1: No license shown after opening

Solution: The current situation is that unity is started directly without downloading the unity hub.

 

Question 2: Unity hub needs to log in but it always shows a white screen

Solution: Adjust dns and environment variables, create a new variable named NODE_TLS_REJECT_UNAUTHORIZED with a value of 0, and then restart the unity hub.


2. New construction:

(1).Open unity hub and select New Project

(2). Select the default 3d here, modify the project name and directory location, and then create project. It seems to take about five minutes to enter the editor interface.

(3).The editor interface is as shown in the figure

The middle part is similar to the preview image. At the bottom are the added presets and written code, as well as material. The left side is the created game object, and the right side is the properties of the game object.

(4). Create a new game object:

All objects in Unity are called game objects (such as new objects, cameras, light sources)

By right-clicking the left object bar and selecting GameObject, you can create a new game object (including video, audio, 3D objects, etc.)

Each game object is composed of different components. Select a component in the object panel and drag it to another component. The selected component will become a child component of that component.

The toolbar includes the grab tool, move tool, selection tool, zoom tool, etc., which can be quickly switched through qwer

(5). Modify attributes

Some properties (transform) can be modified directly through the tools on the toolbar, or through the properties on the right.

Transform: This mainly includes position (position) Rotation (angle) Scale: scaling

Mesh render: triangle renderer

From my understanding, it is used for rendering. After it is disabled, the object disappears.

Material: You can customize the color or texture of the object

3. Write code

Step 1: Right-click the bottom--create--C#script

The second step is to drag the file to the object (here is the ball)

The third step is to double-click to open the editor for editing (vs already configured)

As shown in the figure, the start method and the Update method are created by default. start will only be called at startup, update will be called for every frame update, and then move the position through the following code

Vector3 vector = new Vector3(x, y, z);
transform.Translate(vector * Time.deltaTime);

Run the project and you will see the effect:

Guess you like

Origin blog.csdn.net/m0_60277871/article/details/132796979