My ship is zooming off after it flies, not before - and I can’t make it move even a little bit when it is flying along the track. (See Video) . After I made the video, I added the newYPos script and it just stays at the end, no zooming offscreen - but it still can’t move around when I click ASDW.
Here is my code as well:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerControls : MonoBehaviour
{
[SerializeField] float controlSpeed = 10f;
// Update is called once per frame
void Update()
{
float xThrow = Input.GetAxis("Horizontal");
float yThrow = Input.GetAxis("Vertical");
float xoffset = xThrow * Time.deltaTime * controlSpeed;
float newXPos = transform.localPosition.x + xoffset;
float yoffset = yThrow * Time.deltaTime * controlSpeed;
float newYPos = transform.localPosition.y + yoffset;
transform.localPosition = new Vector3
(newXPos, newYPos, transform.localPosition.z);
}
}