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

error CS1525: Unexpected symbol `offsetX'

$
0
0
I'm making my first ever game, and I got this error: "error CS1525: Unexpected symbol `offsetX'" Can you tell me how can I fix it, answer as fast as possible, please. (: The script: using UnityEngine; using System.Collections; public class CameraTracksPlayer : MonoBehaviour { Transform player; float offsetX; // Use this for initialization void Start () { GameObject player_go = GameObject.FindGameObjectWithTag ("Player"); if (player_go == null) { Debug.LogError ("Couldn't find an object with tag 'Player'!"); return; } player = player_go.transform; offsetX = transform.position.x - player.position.x; } // Update is called once per frame void Update () { if(player != null) { Vector3 pos = transform.position pos.x = player.position + offsetX; transform.position = pos; } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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