1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MArishka [77]
3 years ago
11

I just started game development using unity, I’m trying to control my sphere moving on a flat surface using the W,A,S,D keys, if

anyone knows the code for that using C# ,please help.
Computers and Technology
1 answer:
uysha [10]3 years ago
6 0

Answer:

Explanation:

public class Controlador: MonoBehavior

{

// we declare velocity variable, we can change the value to get more speed

public float velocidad = 3f;

void Start()

{

 

}

void Update()

{

// with this condition we select the key for the movement.

// for example the left arrow or the letter "a"

  if (Input . GetKey(KeyCode . LeftArrow) |I Input . GetKey("a"))

  {

    transform . position += Vector3 . left * velocidad * Time . deltaTime;

  }

   if (Input . GetKey(KeyCode . RightArrow) |I Input . GetKey("d"))

  {

    transform . position += Vector3 . right * velocidad * Time . deltaTime;

  }

   if (Input . GetKey(KeyCode . UpArrow) |I Input . GetKey("w"))

  {

    transform . position += Vector3 . up * velocidad * Time . deltaTime;

  }

   if (Input . GetKey(KeyCode . DownArrow) |I Input . GetKey("s"))

  {

    transform . position += Vector3 . down * velocidad * Time . deltaTime;

  }

}

}

You might be interested in
Select statements about Multiprocessors that are FALSE. a. Asymmetric multiprocessors are a popular form of tightly coupled arch
Inessa [10]

Answer:

The statement about Multiprocessors that is FALSE is:

a. Asymmetric multiprocessors are a popular form of tightly coupled architecture

Explanation:

Symmetric multiprocessors house two or more identical processors sharing a single main memory.  The multiprocessors are tightly coupled, and all of them can access all the connected devices without any preferential treatment of one over the others.  This is unlike asymmetric multiprocessors that do not share a single main memory.   Instead, they have distributed memories.

4 0
3 years ago
Where does blood travel when it leaves the right ventricle of the heart
tensa zangetsu [6.8K]
The right ventricle contracts, and blood is forced through the pulmonary semilunar valve into the pulmonary artery. It then travels to the lungs. Hope this helps!
3 0
2 years ago
Read 2 more answers
um I'm new and I just sign up like right now and brainly says I've reached my daily limit for my questions why?
Natalija [7]

Answer:

Im not sure why but maybe you can find a way to contact the people who own it and see if they know because that hasn't happened to me. How many questions have you asked

Explanation:

7 0
3 years ago
What are two examples of events in the Outlook Calendar?
Natalka [10]
One hour meetings with coworkers and all day workshops.
6 0
2 years ago
Read 2 more answers
What is an algorithm?
hichkok12 [17]
D. Both A and C. In my opinion though...
8 0
3 years ago
Other questions:
  • you are a software engineering consultant and have been called in by the vice president of finance of a corporation that manufac
    10·1 answer
  • What type of device is the printer?
    13·2 answers
  • Which of the following journals is not aimed at the public as well as scientists?
    7·1 answer
  • Which is the correct process for attaching a file?
    12·1 answer
  • Every call to a recursive function has its own code and its own set of ____ and local variables
    5·1 answer
  • Describe a situation in which you have experienced harm as a consequence of a failure of computer security. Was the failure mali
    6·1 answer
  • Which of the following operating systems includes a virtual assistant?<br> Group of answer choices
    8·1 answer
  • Wyatt has a database to keep track of his enormous collection of videos. How can Wyatt find the details for the game Lost on Mar
    11·2 answers
  • What is the Cycle of Dependency?
    14·1 answer
  • HELP 20 points THIS IS ON EDGE IF YOU DON'T KNOW THE ANSWER DON'T RESPOND
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!