Hello, I am creating a 3d game where the player must collect a certain amount of meatballs (stored in thr corner of screen) while avoiding the enemy ai to win. However I am not fluent in C# so for the meatball collecting aspect I followed along with this tutorial: https://m.youtube.com/watch?v=hoY1eWqDo5s
But each time, no matter how many times I re we write the scripts I keep getting this error:
Error CS1061 'int' does not contain a definition for 'Of' and no extension method 'Of' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?)
Here is my game manager code:
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour
{
public static GameManager instance = null;
void Awake()
{
if (instance == null)
instance = this;
else if (instance != null)
Destroy (gameObject);
}
public void Collect (int passedValue, GameObject passedObject )
{
Destroy(passedObject, 1.Of);
// update score value
// update score UI
}
}
I think I may be able to move on without it but I am curious of why this keeps happening specifically with visual studios.
In addition after a certain point the Audio Device stops working. If anyone knows the solution It would be greatly appreciated.
↧