About 125,000 results
Open links in new tab
  1. c# - How to move 2D Object with WASD in Unity - Stack Overflow

    Oct 16, 2017 · I'm coding a simple 2d game that will have the player move in 4-directions using the WASD keys. W = move up A = move left S = move down D = move right My main problem is that I can get two of the keys working only in one axis: either A and D is working for Horizontal while W and S are not working at all for Vertical movement or vice-versa.

  2. unity_basics/wasd_movement_2d/README.md at main - GitHub

    This mechanic shows how to implement movement in 2D for a user's character using a set of input keys. The code below is implemented using the WASD and arrow keys, common sets for many games. However, it can be modified to incorporate/utilize any set of keys, such as IJKL.

  3. How to move a sprite with the WASD keys in a 2D game?

    There are two ways to disable double sides movement: or rewrite move in each if or exit form function after first if passed. Also there is another issue in your script: you need update x axis for A/D buttons and z axis for W/S. For example: public Sprite Up; public Sprite Down; public Sprite Right; public Sprite Left; public float speed;

  4. GitHub - vickeymadhukar/PlayerMovementAWSD: The moveAWSD Unity script

    The moveAWSD Unity script enables basic 2D player movement with W, A, S, D keys. Attached to a GameObject, it utilizes Rigidbody2D for physics-based motion. Adjustable speed via Unity Editor.

  5. c# - WASD movement in unity2d - Stack Overflow

    Mar 2, 2020 · I'm new to unity and wanted to know how can i set the A and D keys to move me right and left with Rigidbody2D. I found this script on a forum but it doesn't seem to work: public float speed = 5f;

  6. Movement Script in C# for Unity · GitHub

    Dec 17, 2015 · what do i change so i use both WASD and ARROWKEYS for control. Just add a second set of if statements with the same parameters. For example: Void moveFunction() {if (Input.GetKey(KeyCode.W)) transform.Translate(0,0,1); if (Input.GetKey(KeyCode.insert new 2nd key code here)) transform.Translate(0,0,1);}

  7. WASD Movement Script - Unity Engine - Unity Discussions

    Jan 20, 2016 · Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum. How to understand compiler and other errors and even fix them yourself: If you post a code snippet, ALWAYS USE CODE TAGS: Need Help With Movement Script! Help with RigidBody2d movement? Hey guys!

  8. WASD/Arrow key movement - Questions & Answers - Unity

    Jun 14, 2017 · I have looked around on the forums, and I can’t seem to find a script that allows a 2D sprite to be moved with WASD or the arrow keys. I’m rather new to Unity, can someone please share a script with me or point me in the right direction?

  9. 2D Movement Script in Unity: A Step-by-Step Guide - HatchJS.com

    Learn how to create a 2D movement script in Unity with this easy-to-follow guide. This tutorial covers everything you need to know, from setting up your project to adding movement controls to your character.

  10. C# Unity Player Movement with WASD Keys - CodePal

    Learn how to create a C# script in Unity for player movement using the WASD keys. Adjust the player's movement speed and control the character in your game scene.

  11. Some results have been removed