Hello, i have a small problem:
I want that if my health points are under 25- the image effect calles CameraMationBlur on the main camera is enabled. the script must be attached to my player, so i wrote:
public GameObject cam;
if (hitPoints <= 25.0f){
cam = GameObject.FindGameObjectWithTag ("MainCamera");
cam.GetComponent();
CameraMotionBlur.enabled = true;
}
...
it doesnt work. i always get this error :(
KerboEngine/Scripts/Player/PlayerCore.cs(1075,42): error CS0120: An object reference is required to access non-static member `UnityEngine.Behaviour.enabled'
and
KerboEngine//Scripts/Player/PlayerCorer.cs(1073,25): error CS0029: Cannot implicitly convert type `UnityEngine.GameObject[]' to `UnityEngine.Camera'
:( Thanks for help :)
↧