Happy Holidays to all! I am new here and just purchased a pro license!!! Woohoo! I have a need for some assistance in getting some functionality set up on my controller game pad for some simulation work I am producing. First off I am an artist and have very little programming skills, so any help would be appreciated. I would like to set the functionality of ‘walking’ to a trigger on my xbox 360 controller(R trigger) and Flight to my(l trigger) and also as a toggle on the keyboard should a client be using the keyboard for user nav. as opposed to the game pad. Is this possible? If it is, would someone be willing to help me out in this endeavor.
Thanks I am doing the tutorials right now, but of course I am jumping ahead as to how I could toggle between two different camera types? Thank you for whatevere help you can give! You guys rock
You can switch between cameras by enabling or disabling one of the cameras from a script eg. the following will disable 2 camera and enable camera 1 after 3 seconds.
var camera1 : Camera;
var camera2 : Camera;
function Start ()
{
yield WaitForSeconds(3);
camera1.enabled = true;
camera2.enabled = false;
}
Thank you so much again! This looks like it will do what I need it to do. One more question… Is there a way to do this, easily?
Say, I am flying over/around my project, and I want to switch to a walking camera mode. Can the walking camera query the x y z location of the flight camera? So that when I switch from flight to walk, the walking camera would ‘drop’ to the ground from the exact position I was flying from, and also vice versa from walk to flight. I hope this makes sense. Sorry for the noobee questions. Thank you for your time.
Thanks so much! I even like the time lapse feature of the script. SUPER! Is there a place in the tutorials where I can find a ‘flight’ camera or perhaps a prefab? Probably in there somewhere and I just haven’t reached it yet via the tutorials/docs. Thanks again you guys truly are the best!!!
Theres also this. I found it in the forum somewhere, I think Joachim may be behind this one too. Please note its a c# script and needs to be named “CameraUpdater”
using UnityEngine;
using System.Collections;
public class CameraUpdater : MonoBehaviour
{
public Camera camera0;
public Camera camera1;
void Update ()
{
if (Input.GetKey ("1"))
{
camera1.enabled = false;
camera0.enabled = true;
}
if (Input.GetKey ("2"))
{
camera1.enabled = true;
camera0.enabled = false;
}
}
}
You could parent one cam to another so they are in the same x,z space, maybe?
AC
Hello, Everyone.
I have some doubts about switch cameras to the camera. I have only one camera I need to switch flight mode to walk mode in a single camera.