I just started unity and I’m doing the tutorial that is provided within the app and I was following this one tutorial about player movement I copied everything exactly like he said in the video . I was trying to control a car and the code that i had written was supposed to make it move forward but when I ran the game it didn’t work
here is the code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
// Basic code for forward moving vechicle
transform.Translate(0, 0, 1);
}
}
Did you add this “PlayerController” component to your car?
I think your velocity is pretty big. If the car just seems to disappear, it’s because it drove away at 60 meters per second or more. Try 1f * Time.deltaTime instead of 1 in your transform line, and it will roll at a more likely scale.