track: compile

type: compile

difficulty: easy

subtype: write

question: Write a Unity MonoBehaviour named Spinner that, in Update, rotates its transform around the Y axis at 90 degrees per second (frame-rate independent). Return ONLY one C# code block.


track: compile

type: compile

difficulty: easy

subtype: write

question: Write a Unity MonoBehaviour named Health with a serialized int field maxHealth and a method TakeDamage(int amount) that reduces a current value and logs it with Debug.Log. Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: write

question: Write a Unity MonoBehaviour named Mover that caches its Rigidbody in Awake and, in FixedUpdate, moves it forward at 5 units/sec using the CURRENT Unity 6 velocity API (no deprecated members). Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: write

question: Write a Unity MonoBehaviour with a coroutine that waits 2 seconds and then logs "done" with Debug.Log, started from Start(). Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: write

question: Define a C# interface IDamageable with a method void TakeDamage(int amount), and a Unity MonoBehaviour named Enemy that implements it. Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: write

question: Write an abstract Unity MonoBehaviour base class Weapon with an abstract method void Fire(), and a concrete subclass Pistol that overrides Fire() to log a message. Return ONLY one C# code block.


track: compile

type: compile

difficulty: trap

subtype: write

question: Write a generic class ObjectPool<T> where T : UnityEngine.Component, with methods T Get() and void Return(T item) backed by a Stack<T>. Return ONLY one C# code block.


track: compile

type: compile

difficulty: trap

subtype: write

question: Write a Unity MonoBehaviour that retrieves every Enemy component in the scene using the CURRENT Unity 6 API (FindObjectsOfType is deprecated/removed) and logs how many were found. Assume an Enemy MonoBehaviour exists. Return ONLY one C# code block, and include a minimal Enemy class so it compiles.


track: compile

type: compile

difficulty: easy

subtype: fix

question:
This Unity script fails to compile. Return the corrected FULL script in ONE C# code block, no explanation:
```csharp
using UnityEngine;
public class Counter : MonoBehaviour {
    int n = 0;
    void Update() {
        n = n + 1
        Debug.Log(n);
    }
}
```


track: compile

type: compile

difficulty: easy

subtype: fix

question:
This Unity script fails to compile (a brace is missing). Return the corrected FULL script in ONE C# code block, no explanation:
```csharp
using UnityEngine;
public class Greeter : MonoBehaviour {
    void Start() {
        Debug.Log("hi");
}
```


track: compile

type: compile

difficulty: medium

subtype: fix

question:
This Unity script fails to compile (a type error). Return the corrected FULL script in ONE C# code block, no explanation:
```csharp
using UnityEngine;
public class Score : MonoBehaviour {
    int points = "0";
    void Add() { points = points + 1; }
}
```


track: compile

type: compile

difficulty: medium

subtype: fix

question:
This Unity script fails to compile (a method name is wrong). Return the corrected FULL script in ONE C# code block, no explanation:
```csharp
using UnityEngine;
public class Logger : MonoBehaviour {
    void Start() { Debug.Print("hello"); }
}
```


track: compile

type: compile

difficulty: trap

subtype: fix

question:
This Unity script uses a deprecated API and must compile under Unity 6 with NO obsolete-member usage. Return the corrected FULL script in ONE C# code block, no explanation:
```csharp
using UnityEngine;
public class Push : MonoBehaviour {
    Rigidbody rb;
    void Awake() { rb = GetComponent<Rigidbody>(); }
    void FixedUpdate() { rb.velocity = Vector3.forward * 5f; }
}
```


track: compile

type: compile

difficulty: trap

subtype: currency

question: Write a Unity MonoBehaviour that sets a Rigidbody2D's velocity to (3, 0) using the CURRENT Unity 6 API (the velocity property was renamed). Cache the Rigidbody2D in Awake. Return ONLY one C# code block.


track: compile

type: compile

difficulty: trap

subtype: currency

question: Write a Unity MonoBehaviour that, in Start, finds the single Camera-like component via Camera.main and logs whether it is null. Then in Update reads Time.deltaTime. It must compile cleanly under Unity 6. Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: write

question: Write a Unity ScriptableObject named GameConfig with a [CreateAssetMenu] attribute and a public int startingLives field. Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: write

question: Write a plain C# class EventBus with a public C# event Action<int> OnScored and a method Raise(int n) that invokes it null-safely. Return ONLY one C# code block.


track: compile

type: compile

difficulty: trap

subtype: write

question: Write a generic Singleton<T> base class where T : UnityEngine.Component, exposing a static T Instance property backed by a static field. Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: write

question: Write a Unity MonoBehaviour that uses LINQ to count how many ints in an int[] field are greater than 10, and logs the count. Return ONLY one C# code block.


track: compile

type: compile

difficulty: easy

subtype: write

question: Write a Unity MonoBehaviour named Player with a private int backing field and a public Health property (get and set). Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: write

question: Write a Unity MonoBehaviour with an enum State { Idle, Running, Dead } field and a method that returns a string via a switch over the state. Return ONLY one C# code block.


track: compile

type: compile

difficulty: trap

subtype: currency

question: Write a Unity MonoBehaviour that sets a cached Rigidbody's linear damping to 2 using the CURRENT Unity 6 API (the drag property was renamed). Cache the Rigidbody in Awake. Return ONLY one C# code block.


track: compile

type: compile

difficulty: trap

subtype: currency

question: Write a Unity MonoBehaviour that, in Start, gets the first Enemy in the scene using the CURRENT Unity 6 API (FindObjectOfType is deprecated) and logs whether it is null. Include a minimal Enemy MonoBehaviour. Return ONLY one C# code block.


track: compile

type: compile

difficulty: medium

subtype: fix

question:
This Unity script fails to compile because the abstract method is not implemented. Return the corrected FULL script in ONE C# code block, no explanation:
```csharp
using UnityEngine;
public abstract class Shape : MonoBehaviour { public abstract float Area(); }
public class Circle : Shape { public float radius = 1f; }
```


track: compile

type: compile

difficulty: medium

subtype: fix

question:
This Unity script fails to compile (a member that does not exist is used). Return the corrected FULL script in ONE C# code block, no explanation:
```csharp
using UnityEngine;
public class Teleport : MonoBehaviour {
    void Start() { transform.SetPosition(0f, 1f, 0f); }
}
```