I finally figured out how to make my camera dynamic during battle scenes using the animator.
From what I understand, having a function attached to the camera, and calling it using a trigger in the animation, is supposed to run that function,
I made 2 cameras.
One is called MainCamera.
The second is SecondCamera.
I created this script for switching the main camera to the second one:
using UnityEngine;
using UnityEditor;
using System.Collections;
public class CamSwitch1 : MonoBehaviour
{
public Camera cam1;
public Camera cam2;
// Use this for initialization
void Switch ()
{
cam1.enabled = false;
cam2.enabled = true;
}
void Switchback ()
{
cam1.enabled = true;
cam2.enabled = false;
}
}
Camera switches fine, except camera 2 shows nothing but black, and plays no animation (thus cant call the switch to main).
What am I doing wrong? I want different cameras for different animations, and eventually want to code in a camera that is in a certain position when events (e.g. attack) are selected, but I cannot even switch to a second camera or animation.
I am aware using UnityEditor is probably unnecessary.
– FallenleaderCheck the camera's culling mask, location and rotation in Scene view (pause game, view that), etc.
– getyour411I should have specified that the second camera was a clone of the first, with only a different tag, and later a different animation.
– Fallenleader@pgilmorepf Hi, Can you please exactly tell, what do you mean by disable everything of this nature including browser, What sort of things you meant and which browser?, are you talking about web browser?
– ashokdamani