This is the script I haven't been able to get to work:
using UnityEngine;
using System.Collections;
namespace AC {
public class SetLimitCamera : MonoBehaviour {
void Start () {
}
void Update () {
}
void SetLimitCam () {
GetComponent<Hotspot>().LimitToCamera(GameObject.Find(GlobalVariables.GetPopupValue (5)).GetComponent<_Camera>());
}
}
}
Its purpose is to make a hotspot visible through the active camera.
In the action list of the trigger that is activated on entering an area;
the camera is switched to,
a global variable is set to the name of this camera
and Object : Send Message is called for each hotspot I want to be visible; using SetLimitCam as defined above.
Not errors are flagged but this appears to have no effect on hotspot visibility.
Any suggestions?
Comments
myHotspot.limitToCamera = myNewCamera;
That would go in the Run() function of a custom action.