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
Question 6 (2 points)
OLga [1]

Answer:

It is all of the above

Explanation:

Technology is seen everywhere like in DVD player , a new medical treatment and skills needed to purify water

4 0
3 years ago
Use the drop-down menus to complete the steps for rearranging the layout of a form.
trasher [3.6K]

Answer:

1. Open the Form

2. Arrange tabs

3. Layout view

4. Reoder and arrange the Layout as desired

5. Press Ctrl + A

6. Choose the remove Layout button

7. Click Save

I am not sure

8 0
3 years ago
How do you flatten a 2D array to become a 1D array in Java?
Leni [432]

Answer:

With Guava, you can use either

int[] all = Ints.concat(originalArray);

or

int[] all = Ints.concat(a, b, c);

Explanation:

Use GUAVA

4 0
2 years ago
Write a recursive method to return the number of uppercase letters in a String. You need to define the following two methods. Th
satela [25.4K]

Answer:

<u>Recursive function with two parameters that return the number of uppercase letters in a String</u>

public static int count(String str,int h)//Defining function

{

      if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z

{

          h++; //incrementing the counter

          if(str.length()>=2){

              return count(str.substring(1),h);//recalling function

          }

      }

      if(str.length()>=2){

              return count(str.substring(1),h); //recalling function

      }

      return h;

  }

This is the recursive function with the name count of return type integer,having parameters str of string type and h of integer type.In this we are checking the characters at a particular position from A to Z.

<u>Recursive function with one parameter that return the number of uppercase letters in a String</u>

public static int count(String str)//Defining function

{

      if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z

{

          count++; //incrementing the counter

          if(str.length()>=2){

              return count(str.substring(1));//recalling function

          }

      }

      if(str.length()>=2){

              return count(str.substring(1)); //recalling function

      }

      return count;

  }

This is the recursive function with the name count of return type integer,having parameters str of string type .In this we are checking the characters at a particular position from A to Z.

<u>Java program that return the number of uppercase letters in a String</u>

import java.util.*;

public class Myjava{

static int count =0;//Defining globally  

 

public static int count(String str,int h)//Defining function

{

      if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z

{

          h++;

//incrementing the counter

          if(str.length()>=2){

              return count(str.substring(1),h);//recalling function

          }

      }

      if(str.length()>=2){

              return count(str.substring(1),h);

//recalling function

      }

      return h;

 

  }

  public static void main(String[] args)//driver function

  {

      System.out.println("Enter a string");//taking input

      Scanner scan = new Scanner(System.in);

      String s = scan.nextLine();

      int h =0;

      System.out.println("Counting the Uppercase letters: "+count(s,h));

  }

}

<u>Output</u>

Enter a string  WolFIE

Counting the Uppercase letters: 4

4 0
3 years ago
1. ____________notes that can be attached to cells to add additional information that is not printed on the worksheet network dr
Anna71 [15]

1. <u>Comments</u> notes that can be attached to cells to add additional information that is not printed on the worksheet network drive.

2. <u>Footer</u> text and/or graphics that print at the bottom of each page headers.

3. <u>Headers</u> text and/or graphics that print at the top of each page rows.

4. <u>Margins</u> the white space left around the edges of the paper when a worksheet is printed comments.

5. <u>Network drive</u> location at a workplace for storing computer files footer.

6. <u>Rows</u> go across (horizontal) margins.

7. <u>Template</u> a file format used to create new files that contain the same data as the template.

<u>Explanation:</u>

On the off chance that you need to add a header or footer to all sheets, select each sheet by right-clicking one of the sheet tabs at the base of the Excel screen and clicking "Select All Sheets" in the spring up menu. It's genuinely basic to put an Excel header on all pages of all worksheets in your record.

A header is a line of content that shows up at the highest point of each page of a printed worksheet. You can change the direction of a worksheet, which is the situation of the substance with the goal that it prints either vertically or on a level plane on a page.

6 0
3 years ago
Other questions:
  • Java
    13·1 answer
  • Write a C++ function, lastLargestIndex that takes as parameters an int array and its size and returns the index of the last occu
    10·1 answer
  • Use the drop-down menus to complete statements about managing meeting responses.
    13·1 answer
  • Employees of Bodegas &amp; Bistros Inc. (2B) maintain a password-protected social media page to "vent about work." When 2B learn
    12·1 answer
  • Jesse wants to create a website with her company name as the address. What should she do next?
    9·1 answer
  • Hey Yo, i need some help, Whats 2+2?
    7·2 answers
  • Carmina works at a fast-food restaurant. During the slow afternoon hours, Carmina always find projects to keep her busy, like wa
    6·1 answer
  • The cost of a postsecondary education increases with the length of time involved in the program.
    10·1 answer
  • C. List three obstacles to effective listening.
    8·1 answer
  • Write an application that allows a user to enter a filename and an integer representing a file position. Assume that the file is
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!