player script unity
C#
//Simple 2D:
private Rigidbody2D RB;
public float speed = 50f;
void Start()
{
RB = GetComponent<Rigidbody2D>();
}
void Update()
{
if (Input.GetKey(KeyCode.D))
{
RB.AddForce(Vector3.right * speed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.A))
{
RB.AddForce(Vector3.left * speed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.W))
{
RB.AddForce(Vector3.up * speed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.S))
{
RB.AddForce(Vector3.down * speed * Time.deltaTime);
}
}
Also in C#:
- Title
- asp.net concatenate link gridview
- Category
- C#
- Title
- write string multiple times c#
- Category
- C#
- Title
- C# how to get public key for InternalsVisibleTo
- Category
- C#
- Title
- c sharp list indexer
- Category
- C#
- Title
- c# return two variables of different types
- Category
- C#
- Title
- get hash c#
- Category
- C#
- Title
- clear combobox c#
- Category
- C#
- Title
- razor preview
- Category
- C#
- Title
- first person camera controller unity
- Category
- C#
- Title
- datetitime contrusctor c#
- Category
- C#
- Title
- if statement conditions c#
- Category
- C#
- Title
- Assets/Scripts/Snake.cs(187,10): error CS0029: Cannot implicitly convert type `UnityEngine.Vector2Int' to `System.Collections.Generic.List<UnityEngine.Vector2Int>'
- Category
- C#
- Title
- block wapalyzer from detecting codeigniter
- Category
- C#
- Title
- animator hash in unity
- Category
- C#
- Title
- c# get directory part of path
- Category
- C#
- Title
- winforms timer c#
- Category
- C#
- Title
- count the number of notes in a given amount c#
- Category
- C#
- Title
- unity rotation
- Category
- C#
- Title
- c# get every point in a line in matrix
- Category
- C#
- Title
- exception handling c# stack overflow
- Category
- C#
- Title
- multidimensional meaning
- Category
- C#
- Title
- how to reference scripts in other scenes unity
- Category
- C#
- Title
- wpf restart application c#
- Category
- C#
- Title
- how to set progress openedge driver name for odbc connection c#
- Category
- C#
- Title
- c# webrequest cookies
- Category
- C#
- Title
- c# loop through repeater items
- Category
- C#
- Title
- unity rotate object relative to camera
- Category
- C#
- Title
- c# ref
- Category
- C#
- Title
- Request.Form
- Category
- C#
- Title
- iterate through dictionary c#
- Category
- C#
- Title
- how to print statement in c#
- Category
- C#
- Title
- how to disable a gameObject unity c#
- Category
- C#
- Title
- random from list c#
- Category
- C#
- Title
- c# remove first 5 characters from string
- Category
- C#
- Title
- .net core authorizationhandlercontext
- Category
- C#
- Title
- how to hide and show object in unity script
- Category
- C#
- Title
- c# getasync response
- Category
- C#
- Title
- sort c#
- Category
- C#
- Title
- convert double to currency c#
- Category
- C#
- Title
- C# sprint key
- Category
- C#
- Title
- c# directories loop
- Category
- C#
- Title
- c# generate random number
- Category
- C#
- Title
- leantween id
- Category
- C#
- Title
- while loop c#
- Category
- C#
- Title
- as c#
- Category
- C#
- Title
- download and run exe c# 1 button
- Category
- C#
- Title
- c# code snippet template
- Category
- C#
- Title
- change z value unity
- Category
- C#
- Title
- convert array object to int[] c#
- Category
- C#
- Title
- unity round vector 3 to nearest integer
- Category
- C#
- Title
- how to make a float in C++
- Category
- C#
- Title
- c# split a string and return list
- Category
- C#
- Title
- MVC creating a counter for products
- Category
- C#
- Title
- unity t-flip flop
- Category
- C#
- Title
- c# access session in class
- Category
- C#
- Title
- how to make rb.addforce 2d
- Category
- C#
- Title
- how to textbox anywhere on chart in c#
- Category
- C#
- Title
- entity framework core
- Category
- C#
- Title
- sending data photon c#
- Category
- C#
- Title
- transform.Translate movement
- Category
- C#
- Title
- how to make % posibility to spawn an object C# in unity
- Category
- C#
- Title
- windows forms iterate through all controls
- Category
- C#
- Title
- c# how to open file explorer
- Category
- C#
- Title
- x angle oes back after 90 unity
- Category
- C#
- Title
- c# change label forecolor code
- Category
- C#
- Title
- unity how to make jump script
- Category
- C#
- Title
- winforms c# add data to datagridview with a button
- Category
- C#
- Title
- c# making a folder
- Category
- C#
- Title
- c# loop
- Category
- C#
- Title
- asp textarea
- Category
- C#
- Title
- unity quaternion
- Category
- C#
- Title
- drag object unity 2d
- Category
- C#
- Title
- c# string remove special characters
- Category
- C#
- Title
- webutility.urlencode space
- Category
- C#
- Title
- c# arraylist
- Category
- C#
- Title
- c# inotifypropertychanged best practices
- Category
- C#
- Title
- convert string to decimal c#
- Category
- C#
- Title
- unity set sprite transparency
- Category
- C#
- Title
- bool toggle unity c#
- Category
- C#
- Title
- visual studio clear text script
- Category
- C#
- Title
- round vector3 unity
- Category
- C#
- Title
- unity mobile controls
- Category
- C#
- Title
- c# list to string join
- Category
- C#
- Title
- c# start process
- Category
- C#
- Title
- asp.net core 3.1: cast jObject to dictionary<string,string>
- Category
- C#
- Title
- find gameobject with tag
- Category
- C#
- Title
- query associative table ef6
- Category
- C#
- Title
- c# close window
- Category
- C#
- Title
- page refresh on button click in c#
- Category
- C#
- Title
- increase variable C#
- Category
- C#
- Title
- bash if null or empty
- Category
- C#
- Title
- c# docstring
- Category
- C#
- Title
- visual studio c# mark class deprecated
- Category
- C#
- Title
- C# extend array
- Category
- C#
- Title
- send type as argument c#
- Category
- C#
- Title
- c# join array
- Category
- C#
- Title
- c# how to delete a file
- Category
- C#
- Title
- httpcontext in .net standard
- Category
- C#
- Title
- how to change text to bold through script unity
- Category
- C#
- Title
- how to copy one array value to another without reference c#
- Category
- C#