Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

C# help with collect/destroy/displaying quantities and Audio source problems

$
0
0
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.

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>