I have this stupid thing called parsing error cs8025 on my GunShot Script
Hi my name is Richard Haley and Ive been having trouble getting rid of the parsing error cs8025 some please please please help me out my script is right here and here is what it is:
using UnityEngine;
using System.Colection;
public class GunShot : MonoBehaviour {
//Use this for initialization
void Start () {
var gunsound = GetComponent.AudioSources
gunsound.Play();
}
//Update is called once per frame
void Update () {
GetComponent.Animation>(Play("GunShot")
}
Please format this question correctly. There are specific tags you can use to place code in a way that is readable. As for your question, there's no real answer. You are using syntax from multiple languages which all clash, whilst also trying to access functions that don't exist. You can read up on the syntax of the two supported languages in the Unity $$anonymous$$anual;
https://docs.unity3d.com/$$anonymous$$anual/CreatingAndUsingScripts.html
Answer by hexagonius · Oct 26, 2016 at 08:23 AM
Your code is just wrong and cannot be parsed (read so it can be compiled).
using System.Colection does not exist it is System.Collections GetComponent is used like GetComponent().Play():
You even used it different in Start and Update. In Update you missed a <
You should start by learning how a class is structured, how the syntax works and then how to find out where the syntax is wrong.
Your answer
Follow this Question
Related Questions
Error CS8025: Parsing Error 3 Answers
CS8025 Parsing error!? 1 Answer
How To Fix Parsing Errors 1 Answer
error CS8025: Parsing error: dont know what to do here 1 Answer