Trying to make it so when the player collides with the Jetpack item it sets the playerpref for the jetpack to 1, then destroys the jetpack. But I can’t seem to make the jetpack disappear.
OnTriggerEnter would be fine too, I just need the jetpack to disappear.
using UnityEngine;
using System.Collections;
public class JetpackPickup : MonoBehaviour {
public int doIHaveJetpack = 0;
void OnCollisionEnter(Collision other) {
if(other.collider.name == "Player")
{
PlayerPrefs.SetInt("doIHaveJetPack", 1);
Destroy(other.gameObject);
}
}
}