Hey guys, this is the code for my player.cs:
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public float JumpHeight = 5;
public SpriteRenderer sRenderer;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void Jump()
{
if (GeometryUtility.TestPlanesAABB(GeometryUtility.CalculateFrustumPlanes (Camera.main).sRenderer.bounds))
{
rigidbody2D.velocity = new Vector2(0,JumpHeight);
}
}
}
This is the error I get: Type UnityEngine.Plane[]' does not contain a definition for
sRenderer’ and no extension method sRenderer' of type
UnityEngine.Plane’ could be found (are you missing a using directive or an assembly reference?)
I can’t seem to figure out what I did wrong :c. Some help would be appreciated.
Ab