Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Move character by touch

$
0
0
Hello, I'm trying to move my character by touch. Let's say I swipe right I want my character to keep moving to the right, and let's say I swipe forward then I want my character to keep moving forward. I have a problem with my code and the problem is when I swipe forward my character going up instead of going forward.

Code (CSharp):
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class charactercontroller : MonoBehaviour
  5. {
  6.     float movespeed = 0.4f;
  7.  
  8.     void Update()
  9.     {
  10.         if...
Move character by touch

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>