question re vehicles examples

Hi guys, hopefully someone can help with this.

Ive copied the boat template exactly, ( I have the origional boat in the scene, plus one I have introduced -I have deleted all the other vehicles), and my problem is the new boat bounces around like crazy, and doesnt sit still. Ive scaled up the box collider for the water quite massively, and perhaps thats the problem, except that the origional boat bobs away just fine.
Any ideas?
AC

The boat consists of more than the script. There are also triggers for the water. Make sure you get that into your scene as well just like in the sample scene. Also make sure you are working on the same scale.

Hi Joachim

I see the water colliders actually a trigger…

I am working out from the scene file provided, and have solved the issue. I am working at a much larger scale, and have replaced the water collider mesh with a densely polygoned plane, and the extra geometry seems to have given the scene enough information to calculate corectly.

Maybe I could quiz everybody on this?
The helicopter setup in there is awesome, but my computer just cant handle it. I rebuilt the helicopter with a low res model and it still chugs really slow, so Ive made a simplified script that approaches the issue quite differently. The part I cant get working, is disabling/enabling user input. Basically this script and the helicopter it is attatched to is active from the start, and I want to disable it so that it only works when the player chooses to use the helicopter. As well as this, the helicopter has a mouselook on it, that Id like to disable/enable also. Thanks for any help

private var queryUserInput = true;

function GetControlString(gui : GUIText) {
	gui.text="Use arrow keys or W/A/S/D to control the helicopter,\nQ/Z for choosing the ground altitude.";
}
function SetupCamera() {
	if(Camera.main.GetComponent(SmoothFollow)!=null)
	{
		Camera.main.GetComponent(SmoothFollow).enabled=true;
		Camera.main.GetComponent(SmoothFollow).target=transform;
		Camera.main.GetComponent(SmoothFollow).distance=15;
		Camera.main.GetComponent(SmoothFollow).height=5;
	}
	Camera.main.transform.parent=null;
}
function SetEnableUserInput(enableInput)
{
	queryUserInput=enableInput;
}
function Update() {
   if(Input.GetKey("q"))
    transform.Translate(0, 20* Time.deltaTime, 0 * Time.deltaTime);
     if(Input.GetKey("z"))
    transform.Translate(0, -20* Time.deltaTime, 0 * Time.deltaTime);
     if(Input.GetKey("w"))
    transform.Translate(0, 0, 20 * Time.deltaTime);
     if(Input.GetKey("s"))
    transform.Translate(0, 0, -20 * Time.deltaTime);
      if(Input.GetKey("a"))
    transform.Translate(-20 * Time.deltaTime, 0, 0);
     if(Input.GetKey("d"))
    transform.Translate(20 * Time.deltaTime, 0, 0);
    }

AC

The script is most certainly not a performance issue.
As i said many times before all the models in the unofficial vehicle sample are not appropriate for game use so you need to replace all. Best create a new scene and just setup all the triggers / models in the same way.

Sorry Joe-it must just be the way Im using it. I just noticed that whenever I “crash” the chopper (collide the rotor with something) the performance increases. The geometry is still there, but not the script. I understand the models arent ideal, so Im only using the boat.

Nevermind, forget I asked. Im trying a different method to solve the problem in my previous post.

No offence
AC

Hmm where are these examples of which you speak? :slight_smile:

Weasel wants wheels!

Here is the link

http://forum.unity3d.com/viewtopic.php?t=4762

Thank you sir.