Hi guys im making a 3D platformer game for mobile i created a script for touch but the problem is the char move but the animation dosent move what should i do
You should give us more information. Remember about https://discussions.unity.com/t/481379
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ec : MonoBehaviour
{
public float speed = 5.0f;
void Update()
{
if (Input.touchCount == 1)
{
Touch touch = Input.touches[0];
if (touch.position.x < Screen.width / 2)
{
transform.position += Vector3.left * speed * Time.deltaTime;
}
else if (touch.position.x > Screen.width / 2)
{
transform.position += Vector3.right * speed * Time.deltaTime;
}
}
}
}
is the script i used
https://www.youtube.com/watch?v=DaiYrM4iNn0
and what happens
i forgot to say what happens if i use pc script will it work on android ?
There’s no code (posted) that does anything with animations.
If you’re asking whether code is/can be compatible between pc and android, the answer is that most of it is.
Your example could just as well have used GetMouseButtonDown(0), since you only care about 1 touch.