So Iam really new to coding and Unity overall and I got this Error and cant move foward … Anyone can Help ?
Error: “Assets/Scripts/CameraFollow.cs(22,58): error CS1001: Unexpected symbol `<', expecting identifier”
Looks like its in line 22/23
SCRIPT :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour {
public Transform target;
public Transform leftBounds;
public Transform rightBounds;
public float smoothDampTime = 0.15f;
private float smoothDampVelocity = Vector3.zero;
private float camWidth, camHeight, levelMinX, levelMaxX;
// Use this for initialization
void Start () {
camHeight = Camera.main.orthographicSize * 2;
camWidth = camHeight * Camera.main.aspect;
float leftBoundWidth = leftBounds.GetComponetInChildren. ().Bounds.size.x / 2;
float rightBoundssWidth = rightBounds.GetComponentInChildren ().bounds.size.x / 2;
levelMinX = leftBounds.position.x + leftBoundsWidth + (camWidth/2);
levelMaxX = rightBounds.position.x - rightBoundssWidth - (camWidth/2);
}
// Update is called once per frame
void Update () {
if (target) {
float targetX = Mathf.Max (levelMinX, Mathf.Min (levelMaxX, target.position.x));
float x = Mathf.SmoothDamp (transform.position.x, targetX, ref smoothDampVelocity, smoothDampTime);
transform.position = new Vector3 (x, transform.position.y, transform.position.z);
}
}
}