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
Suppose a program contains 500 million instructions to execute on a processor running on 2.2 GHz. Half of the instructions takes
Anit [1.1K]

Answer:

1.48 s

Explanation:

Number of instructions = 500 million = 500 * 10⁶

clock rate = 1 / 2.2 GHz = 1 / (2.2 * 10⁹ Hz) = 0.4545 * 10⁻⁹ s

We need to compute the clocks per instruction (CPI)

The CPI = summation of (value * frequency)

CPI = (50% * 3 clock cycles) + (50% * 10 clock cycles)

CPI = (0.5 * 3) + (0.5 * 10) = 1.5 + 5 = 6.5

Execution time = number of instructions * CPI * clock rate

Execution time = 500 * 10⁶ * 6.5 * 0.4545 * 10⁻⁹ =1.48 s

5 0
3 years ago
Suppose Alice uses the RSA system with a very large modulus n for which the factorization cannot be found in a reasonable amount
Yuliya22 [10]

Answer:

Encryption method security:-

  • Encryption method representing each alphabetic character as an integer between 0 and 25.
  • Now, apply RSA algorithm for each integer is not an efficient secure encryption method.

Explanation:

  • Let consider alphabetic characters set {A, B... Z} .
  • Each alphabetic character forms a set of message block values M={0,1,2...,25).
  • From encryption method the corresponding cipher text block value C = {0e mod n,1e mod n, 2e mod n,..., 25e mod n}.
  • Then, compute the cipher text with knowledge of Bob's public key;
  • If the public key is generated, then possibility to decrypt the cipher text to plain text.
  • The generated public key is easily calculated by everyone and security is lost.
  • Therefore, the encryption method is not secure.

Encryption method is not secure, Most efficient attack against this method:-

  • Now, compute the encryption message with the function Me mod n for all the possible values of M.
  • This is the most efficient attack against the scheme in encryption method.
  • Then, create a look-up table with cipher text as an index to the corresponding plain text as a value for appropriate location in the table.
4 0
3 years ago
In two to four sentences, describe how you would select a function.
Mila [183]

Explanation:

As a result, it is important not to overlook any of the sources of information that indicate what the form of the model should be. Answer Not ...

Knowing Function Types Helps: Another helpful ingredient in model selection

5 0
3 years ago
What are two reasons for entering the ping 127.0.0.1 command on a windows pc?
Hunter-Best [27]

127.0.0.1 is the loopback Internet Protocol (IP), the address is used to establish an IP connection to the same computer being used by the end-user.

The some reason that a person will command a ping 127.0.0.1 in a command prompt is because they will check if the NIC and drivers implementation is functional and it used in testing the TCP/IP.

4 0
4 years ago
Read 2 more answers
The query [windows], English (US) has two dominant interpretations: the operating system and the windows in a home.
Flauer [41]

Answer:

B. False

Explanation:

Microsoft Windows is a graphics user interface operating system that uses windows query to search for information in its directory. There are different versions and updates of the windows OS, with latest being window 10 1903. The different version of the windows 10 OS is windows professional, Home, Enterprise etc. As time goes on, more updates will be released for better and advanced security.

3 0
4 years ago
Other questions:
  • What aspect of web design is Gloria following when she uses the same color
    5·2 answers
  • Which signal types are represented by a continuous wave form?
    11·1 answer
  • Consider the following code segment:
    5·1 answer
  • Which microphones are considered to have the best quality?
    12·2 answers
  • A display that is thin, flexible, light, and easy to read in all types of light is
    9·2 answers
  • Late at night, some traffic signals change patterns and become _____.
    9·2 answers
  • Create a parent class called Shape with width and height parameters of type double and a function that returns the area of the s
    12·1 answer
  • I’ll give Brainly if u answer all please <br> ASAP
    12·1 answer
  • Which of the following is the best description of an ip address?
    8·1 answer
  • What does it mean when someone silences notifications?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!