- Home /
Question by
LucaH97 · Aug 11, 2015 at 12:43 AM ·
prefabgetcomponentaccess
Can't Access Prefab Script from FPS Controller
Hi, I want to create a script, which will be attached to the same GameObject as the standard FirstPersonController script in Unity 5. I need to get the velocity value out of that script, so I can change the Vignette of the Camera according to the speed, for a cool effect.
Here's the Problem: I cant access the script! It is in the same folder as the FirstPersonController Script, and Unity shows me an error, saying that "The type or namespace 'FirstPersonController' could not be found".
Here's the script. What am I doing wrong??
using UnityEngine;
using System.Collections;
public class Viginette_Int : MonoBehaviour {
public GameObject FPS;
private FirstPersonController FPS_SCR;
// Use this for initialization
void Start () {
FPS_SCR = this.GetComponent<FirstPersonController>();
}
// Update is called once per frame
void Update () {
}
}
Comment