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
Discuss the role of the concept behind the "Internet of Things (IoT)" in today's digitally connected society.
AlekseyPX

Answer:

IoT Definitions: The term Internet of Things generally refers to scenarios where network connectivity and computing capability extends to objects, sensors and everyday items not normally considered computers, allowing these devices to generate, exchange and consume data with minimal human intervention.

Explanation:

hope that helps

7 0
3 years ago
People who are reading this:
Gnom [1K]

Answer:

Awe thanks hun!

Explanation:

3 0
3 years ago
Read 2 more answers
PLEASE HELP ASAP I WILL GIVE BRAINLIEST TO CORRECT ANSWER
salantis [7]
The correct answer is letter b
8 0
3 years ago
Read 2 more answers
Name two commercial tools that can make a forensic sector-by-sector duplicate of a drive to a larger drive.
Temka [501]

Answer:

e34d4e

Explanation:

5 0
3 years ago
Data in the form of digits is called
Flauer [41]
Numeric data because it consist of numbers
5 0
2 years ago
Other questions:
  • The angles of a quadrilateral are in the ratio 1:2:3:4 what is the largest angle​
    5·1 answer
  • A user reports that nothing happens when he or she attempts to print from the computer at his desk. This points to a possible pr
    11·2 answers
  • An iPad Is An Example Of Which Type Of Computer?
    11·2 answers
  • The class at the top of exception class hierarchy is ..........................
    12·1 answer
  • How to use github to creat a blog?Thank you
    10·1 answer
  • Explain the importance of mobile computing in communication​
    5·1 answer
  • What is a command-line program?
    8·2 answers
  • Production cost can be reduced using technology. Explain
    5·1 answer
  • What is the largest value that can be represented by 6 binary digits? .
    5·1 answer
  • A ____________ is a collection of commands given a name.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!