This question was
closed Mar 22 at 03:23 PM by
SamuellaThe2nd for the following reason:
I was being stupid... wrong class name
Question by
SamuellaThe2nd · Mar 20 at 11:19 AM ·
c#crash
Unity Crashes When Adding Script To GameObject
So i just got into C# coding for unity and i cant figure out why this small script crashes unity completely...
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Lvl2Unlock : MonoBehaviour
{
void Start()
{
PlayerPrefs.SetInt("Lvl1win" , 1);
Debug.Log("PlayerPref: Lvl1Win : Has Been Created.");
}
}
Video of what happens: https://drive.google.com/file/d/1HMoacpL7hteB0lt8VCJMTUsjQIlwob1G/view?usp=sharing
screenshot-2022-03-20-111535.png
(7.8 kB)
Comment
Follow this Question
Related Questions
ios app crashes on start 0 Answers
Why does my game crash on my mobile when I try to load the scene with this interstitial ad script? 0 Answers
Builds are no longer running on Windows 7 0 Answers
Visual Studio 2015 keeps crashing... 1 Answer
(C#) Invoke giving null reference exception, crashing unity 0 Answers