About 4,580 results
Open links in new tab
  1. How to move 2D Object with WASD in Unity - Stack Overflow

    Oct 16, 2017 · My code below only works for horizontal movement. Shouldn't the vertical movement be working too? I'm just starting out with basic 2D Unity programming: public class …

  2. unity game engine - C# 2D platformer movement code - Stack …

    Oct 2, 2015 · This code will keep on jumping even though it is not on the ground how do you stop this (using Unity). The Code: using UnityEngine; using System.Collections; public class …

  3. touch - Unity 2D player movement - Stack Overflow

    Apr 10, 2020 · Here is my 2D Player Movement Controller. Code (Character Controller) - using UnityEngine; using UnityEngine.Events; public class CharacterController2D : MonoBehaviour { …

  4. c# - Move simple Object in Unity 2D - Stack Overflow

    I'm trying to move a simple Object in Unity but I get the following error message: cannot modify the return value of unityengine.transform.position because itar is ...

  5. Unity - How To Make a 2d grid movement system - Stack Overflow

    Jul 9, 2022 · This code simply moves the gameObject up a certain value when a button is pressed, and down when another button is pressed.

  6. Unity C# Script Moving a character 2D - Stack Overflow

    Mar 28, 2015 · I'm trying to make a script to control the character. I want the character to move a certain distance to the right while alternating LEFT ARROW and then RIGHT ARROW inputs. …

  7. unity game engine - 2D Movement for 4 directions only working …

    Jul 23, 2018 · Your code uses else if for all four directions. This means that the character can only move in one direction at a time. If 'A' is pressed, then all of the else branches are ignored. If 'D' …

  8. c# - Unity 2d jumping script - Stack Overflow

    Jun 12, 2015 · Does anyone have a good jumping script for 2d games in unity? The code I have works but still is far from jumping, it looks like it is flying. using UnityEngine; using …

  9. c# - Unity3D Player movement script - Stack Overflow

    Sep 24, 2016 · I have a script which allows you to control a player, and jump. However, I'm trying to make it so the player is constantly moving, and not controllable via WASD keys on the …

  10. c# - Move object in Unity 2D - Stack Overflow

    Apr 24, 2022 · In the pasted code it’s not really a matter of fixing a problem with the movement code because there basically is no movement code to fix. Just telling you what line to type …

Refresh