using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class LoadDixia : MonoBehaviour { // Start is called before the first frame update public Transform car; public Transform carpos; public GameObject obj1; public GameObject obj2; public GameObject obj3; private void Start() { // car.GetComponent().enabled = false; } void Update() { if (Input.GetKeyDown(KeyCode.JoystickButton10)) { SceneManager.LoadScene("Parking"); } if (Input.GetKeyDown(KeyCode.JoystickButton6)) { obj1.SetActive(false); obj2.SetActive(false); obj3.SetActive(true ); car.GetComponent().isKinematic = true; car.GetComponent().isKinematic = false; car.transform.position= carpos.transform.position; car.transform.rotation = carpos.transform.rotation; this.gameObject.SetActive(false); // car.GetComponent().enabled = true; } } }