Unity C# Move an Object with a Key press
Channel:
Subscribers:
33,700
Published on ● Video Link: https://www.youtube.com/watch?v=CvmJL6dn-hM
How to move a player with key strokes.
First, drag the image into the Asset section and then into the scene.
Second, add a Rigidbody2d, this allows for the application of physics to the object, and set gravity to 0.
Third, add a script which defines the key strokes you wish to check for.
Fourth, add the IF statements to declare what should happen when those keys are pressed.
Lastly, add the velocity statements.
Other Videos By Design and Deploy
2015-10-12 | Anime Studio Pro - Bouncing and Distortion - Ex 1-Translate Point Tool |
2015-09-13 | Unity C# - GetComponent Tutorial Example 1 |
2015-08-25 | Unity C# - Prefabs and Instantiation - Example 2 Projectiles |
2015-08-24 | Unity C# - Creating and Instantiating Prefabs - Example 1 Tiling |
2015-08-21 | Unity C# - Collision detection and destroying objects |
2015-08-20 | Unity C# - Mouse Over Text / Clickable text |
2015-08-19 | Unity C# - Full Screen Fade |
2015-08-17 | Unity C# How to add a Delay / Timer |
2015-08-16 | Unity C# Change Object Transparency |
2015-08-16 | Unity C# How to rotate an object using key press |
2015-08-16 | Unity C# Move an Object with a Key press |
Tags:
C# (Programming Language)
Unity (Software)