getAxis doesn't work..
i wrote this codes to move my character up and down but it doesn't work... what's the problem?
using UnityEngine;
using System.Collections;
public class upside : MonoBehaviour {
float speed=5;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float upside=Input.GetAxis("vertical")*speed*Time.deltaTime;
transform.Translate (0,upside, 0);
}
}
Comment
Answer by hexagonius · Jan 24, 2016 at 08:11 AM
Check vertical is not actually Vertical
be sure to attach the script to some gameobject
finally add Debug.Log to see where the code fails.
what is "Debug.Log"? i checked first and second thing you told and there was no problem
Your answer
Follow this Question
Related Questions
GetAxis help? 1 Answer
3 lane change scripting with vertical movement problem 1 Answer