Sorry but I seem to be getting that "the namespace already contains a definition for " error concerning the Hovermotor and the Hoveraudio script Here is the master script
using UnityEngine;
using System.Collections;
public class HovertankExitEnterX : MonoBehaviour {
//This Vehicle Information
Transform thisVehicle;
HoverMotor myHoverMotor; //Motor Script, this will be whatever your vehicle uses
HoverAudio myHoverAudio; //Motor Audio Script, this will be whatever your vehicle uses
GameObject myCamera ; //Camera for this vehicle
GameObject playerExitPosition; //Position to put the player on exiting vehicle
public GameObject myCanvas;//Basic control information
//This is the Player information
GameObject myPlayer;//UFPS Player game object
FirstPersonController myController;//UFPS Player controller
Input myInput;//UFPS Player Input
//State of this vehicle, if we are in the vehicle or not
bool InThisVehicle=false;
void Start ()
{
//Set references to everything
thisVehicle = this.GetComponent<Transform>();
myHoverMotor = thisVehicle.GetComponent<HoverMotor>();
myHoverAudio = thisVehicle.GetComponent<HoverAudio>();
myCamera = thisVehicle.GetComponentInChildren<Camera>().gameObject;
playerExitPosition = thisVehicle.FindChild("PlayerExitPosition").gameObject;
//turn off Vehicle scripts and camera on start
myHoverAudio.enabled=false;
myHoverMotor.enabled=false;
myCamera.SetActive(false);
if(myCanvas)
myCanvas.SetActive(false);
}
//Exit vehicle keyboard input. In fixed update so it doesn't move at computer speed
void FixedUpdate ()
{
if(InThisVehicle)
{
//Change the Input to whatever you want to use
if(Input.GetKeyDown(KeyCode.Z))
ExitVehicle();
}
}
public void ExitVehicle()
{
myPlayer.SetActive(true);//turn on the player
myController.SetPosition(playerExitPosition.transform.position);//move the player
myInput.enabled=true;//enable the player's input
myHoverMotor.enabled=false;//turn off vehicle stuff
myHoverAudio.enabled=false;//turn off vehicle stuff
myCamera.SetActive(false);//turn off vehicle stuff
InThisVehicle=false;//We aren't in the vehicle anymore
if(myCanvas)
myCanvas.SetActive(false);
}
public void EnterVehicle()
{
myPlayer.SetActive(false);//turn off the player
myHoverMotor.enabled=true;//turn on vehicle stuff
myHoverAudio.enabled=true;//turn on vehicle stuff
myCamera.SetActive(true);//turn on vehicle stuff
InThisVehicle=true;//We are in the vehicle now
if(myCanvas)
myCanvas.SetActive(true);
}
//Make sure your trigger collider is big enough for the player to interact
//Also, make sure the Exit position is outside the trigger area
void OnTriggerEnter(Collider other)
{
//if a player enters trigger and the player isn't already in the vehicle
//just in case there are multiple players
if(other.gameObject.tag=="Player"&&InThisVehicle==false)
{
myPlayer=other.gameObject;//Get the player
myController=myPlayer.GetComponent<FirstPirstPersonController>();//Get the controller
myInput=myPlayer.GetComponent<Input>();//Get the input
EnterVehicle();//Run the EnterVehicle function
}
}
}
And here sre the subscripts
using UnityEngine;
using System.Collections;
public class HoverAudio; MonoBehaviour {
public AudioSource jetSound;
private float jetPitch;
private const float LowPitch = .1f;
private const float HighPitch = 2.0f;
private const float SpeedToRevs = .01f;
Vector3 myVelocity;
Rigidbody hoverRigidbody;
void Awake ()
{
hoverRigidbody = GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
myVelocity = carRigidbody.velocity;
float forwardSpeed = transform.InverseTransformDirection(carRigidbody.velocity).z;
float engineRevs = Mathf.Abs (forwardSpeed) * SpeedToRevs;
jetSound.pitch = Mathf.Clamp (engineRevs, LowPitch, HighPitch);
}
}
using UnityEngine;
using System.Collections;
public class HoverMotor : MonoBehaviour {
public float speed = 90f;
public float turnSpeed = 5f;
public float hoverForce = 65f;
public float hoverHeight = 3.5f;
private float powerInput;
private float turnInput;
private Rigidbody hoverRigidbody;
// System vars
bool grounded;
Vector3 moveAmount;
Vector3 smoothMoveVelocity;
float verticalLookRotation;
float MovePosition;
Transform cameraTransform;
void Awake ()
{
hoverRigidbody = GetComponent <Rigidbody>();
}
void Update ()
{
powerInput = Input.GetAxis ("Vertical");
turnInput = Input.GetAxis ("Horizontal");
}
void FixedUpdate()
{
Ray ray = new Ray (transform.position, -transform.up);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, hoverHeight))
{
float proportionalHeight = (hoverHeight - hit.distance) / hoverHeight;
Vector3 appliedHoverForce = Vector3.up * proportionalHeight * hoverForce;
hoverRigidbody.AddForce(appliedHoverForce, ForceMode.Acceleration);
}
hoverRigidbody.AddRelativeForce(0f, 0f, powerInput * speed);
hoverRigidbody.AddRelativeTorque(0f, turnInput * turnSpeed, 0f);
Vector3 localMove = transform.TransformDirection(moveAmount) * Time.fixedDeltaTime;
hoverRigidbody.MovePosition(GetComponent<Rigidbody>().position + localMove);
Vector3 localMove = transform.TransformDirection(moveAmount) * Time.fixedDeltaTime;
hoverrigidbody.MovePosition(hoverrigidbody.position + localMove);
}
}
These are scripts I downloaded from the Hover In and Out vehicles Youtube example just stuck on this one so far help please