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]
4 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]4 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
When I’m design view, Henrietta deleted a previous criterion, added a new column, and filtered patients’ age. Which best describ
BaLLatris [955]

Answer:

Explanation:

b

8 0
3 years ago
Different units of CPU ?
deff fn [24]
The two typical components of a CPU include the following:<span>--The arithmetic logic unit (ALU), which performs arithmetic and logical operations. --<span>The control unit (CU), which extracts instructions from memory and decodes and executes them, calling on the ALU when necessary.</span></span>
3 0
3 years ago
Display all the natural numbers from 1 to 100 that are exactly divisible by 3 and 7 using FOR … NEXT. Without using Mod
Tcecarenko [31]

Answer:

FOR i% = 1 TO 100

 IF ((i%\3) = i%/3) AND ((i%\7) = i%/7)  THEN

   PRINT i%

 END IF

NEXT i%

Explanation:

Of course using MOD would be cleaner, but another way to check if a number is integer divisable is to compare the outcome of an integer division to the outcome of a floating-point division. If they are equal, the division is an integer division.

The program outputs:

21

42

63

84

6 0
3 years ago
What may happen if a larger number of computer users are attempting to access a Web site at the same time that u r??? I think it
Semmy [17]
I think if a large number are accessing at the same time you would have to wait for many to clear up

3 0
3 years ago
Assume that the int variables i, j and n have been declared , and n has been initialized . write code that causes a "triangle" o
SIZIF [17.4K]

Here you go,

class Program

   {

       static void Main(string[] args)

       {          

          int n,i,j;

          Console.Write("Enter size: ");

          n = Convert.ToInt32(Console.ReadLine());

          for (i = 1; i <= n; i++)

          {

              for (j = 1; j <= i; j++)

              {

                  System.Console.Write("*");

              }

              System.Console.Write("\n");

          }          

           Console.ReadLine();

       }

   }

5 0
3 years ago
Other questions:
  • Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompt
    9·1 answer
  • What might happen if a computer has too many applications running at one time?
    15·1 answer
  • Why were computer users excited by the introduction of the first Macs?
    14·1 answer
  • HURRY! The steps for printing mailing labels are available after you click which icon?
    15·1 answer
  • An example of software most commonly associated with productivity software is ____.
    12·1 answer
  • 6. Which of the following is malware? (1 point)
    10·2 answers
  • Which is an example of a local government enforcing a national law?
    5·2 answers
  • What type of data would a RDBMS store in a linked list, two-way linked list, or B-trees? What are the advantages and disadvantag
    5·1 answer
  • In order to restrict editing to a document, a user will go to Review, , Restrict Editing, and will then select what kinds of edi
    12·1 answer
  • If you wish to install a new OS without disturbing the old one so that you can boot to either OS, what type of boot setup should
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!