I am trying to make a car spawn with the press of a button on the keyboard (F) and then destroy it when i am at my destination and out of the car if that makes any sense…
Here’s the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KeyTriggerTest : MonoBehaviour
{
public GameObject Model_Misc_Buggy1;
// Start is called before the first frame update
void Start()
{
if(Input.GetKeyDown(KeyCode.F));
GameObject = (Model_Buggy1);
if (Input.GetKeyDown(KeyCode.F));
Destroy(Model_Misc_Buggy1);
}
// Update is called once per frame
void Update()
{
}
}
Any help is GREATLY Aprreciated!