Unity3d first example-making a simple sphere colliding wall surface

Source: Internet
Author: User

Ideas

Of course, first of all, we should build a new ground, there is nothing on the ground (floor)

Build a wall wall, and a wall is made up of 100 prefabricated cubes.

We can't let the fired bullets bullet and shoot in one Direction shoot

So we need the camera to move with the arrow keys pressed down.

float h= input.getaxis ("horizontal") *time.deltatime*speed;
Float V=input.getaxis ("Vertical") *time.deltatime*speed;
Transform. Translate (H,0,V);

Second, create a pre-fabricated sphere, as bullet, when you press the left mouse button Fire1,

Create a prefab and add a forward force to the bullet

Bullet.addforce ()

some of the minor problems that---------have encountered

1. First the View panel inspector cannot find the properties of C # because the global variable does not have the public property added

2. Secondly, when the small ball is generated, there is no forward, in time to add the Addforce attribute to bullet, because the strength is too low,

Bullet. Addforce (v3*);

Just give a 1500 of the force.

------- did not resolve the issue,

How to print, how to debug the program, the next program to solve these problems

----do not understand the question, the following sentence is not very understanding, it is now understood

Input.getaxis ("horizontal") *time.deltatime*speed;

To get x-axis coordinates multiplied by two frames, the interval between 5 cells is moved.

Unity3d first example-making a simple sphere colliding wall surface

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.