Whee lAlignmen Script Help

Hello i follow this tutorial from this site:
http://www.gotow.net/andrew/wordpress/?page_id=78&cpage=1#comment-5482

but when i add WheelAlignment_Script to respective wheels, the wheels is incorrect possition, any way to put this script work whit any veichle whit any scale etc…
i try put any volue in wheels collider but hard to fit the wheels of my car.
Or update this tutorial.

My car:

422800–14701–$Police Car.zip (458 KB)

I need help here.

I made an box as an health pick-up, and my damage script for the player and the same for A.I cars, only need how to add extra health.

Need an script that add extra health to the player and A.I cars if collide whit the box. I try many scripts from here but dont work whit my script.

Here is the script:
DAMAGE_SCRIPT:

I believe that you are looking for the collision.gameObject.tag or something would identify the difference between the ai collider and the pickup collider. So if all pickups had a name of Pickup, you could say if(collision.gameObject.name==“Pickup”){ do this… }

i try that , i don´t know what i miss.
is ± like my Score system:

before this:

Debug.Log(Point.gameObject.name + " collision entered");

put:

(collision.gameObject.name==“Pickup”){ do this… } ???

The problem is to add volue health to damage_script.

Any example???

you have swapped to a trigger… before you were using:

function OnCollisionEnter(collision : Collision)

to:

function OnTriggerEnter(Point : Collider){

collision.gameObject will not work with that. You may wish to look in the documentation for collider and see how to get the other object.

//-----------------------------------------------------------------------------------------------------------
I know that. The code of the top of the topic, was just to simplify.

In my pick-up box script I use (function OnCollisionEnter (collision: Collider))

Simply just need, a health pick up the script, that when I or AI collides with the box that adds life and destroy the box itself and reappears on the same site through a certain time.

That it.

427719--14805--$InGame.png

Here is the correct (Damage-Script): player and A.I.

Here is the game:
http://www.megaupload.com/?d=MX4WRHJD

If nacessary i share all my project to help me out. by requesting.

Well i put the basic health for my player:
All works fine. need PickUp after i get it , reapers pass an few secs.
1- PlayerDamage-Script: (This is in player)

2-PlayerHealth-script(In GUITexture)

3-PickUpHealth-Script(In pickup box)

My script don´t work if i add gameobject.active = false;
Works fine whit renderer.enabled. but need to remove the object, be couse it stiil there and health up , if i collide the same spot of health pack.

The health object don´t reapears if i add “gameObject.active =??”

Any solution???

On a deactivated object, the script is also deactivated so the OnTriggerExit will never get called. You might be able to use an “if” statement to stop the object being updated while it is hidden or else use Destroy to remove it and then instantiate a new object to replace it.

Ok, lets forget the health part:(

My big problem , is A.I car, i can figured out the problem. I collide or they collide the cars run reverse, before run in correct possition after an collision.

How to fix that.
The full car tutorial can be downloaded from this site:
http://www.gotow.net/andrew/wordpress/?page_id=78&cpage=1#comment-5482

My game:
http://www.megaupload.com/?d=4N7Y53E3
Press start Button to play.

This game is Type destruction derby The A.I have health then explode, and the player too;)
gain point on collision.

A.I script to fix:

Any one still alive???

I see no one can help me out :frowning: i undertand:(

are asking too much, nobody likes going throgh huge piece of code. Try to cut your problem into small pieces and present them nicely

On A.I crash and if run reverse, reset the car position, so car start going to right way?!

I tink is the waypoint behavior, when car A.I crash and return to path but if car is backwards position continue on the path,
the car A.I if we’ can determinate the position of the object. if object is moving to -velocity, and reset the car position, so car start going to right way.

function GetWaypoints ()
{
 // Now, this function basically takes the container object for the waypoints, then finds all of the transforms in it,
 // once it has the transforms, it checks to make sure it's not the container, and adds them to the array of waypoints.
 var potentialWaypoints : Array = waypointContainer.GetComponentsInChildren( Transform );
 waypoints = new Array();
 
 for ( var potentialWaypoint : Transform in potentialWaypoints )
 {
  if ( potentialWaypoint !=  waypointContainer.transform ) //!=
  {
   waypoints[ waypoints.length ] = potentialWaypoint;
  }
 
 }
}
 
 
function NavigateTowardsWaypoint ()
{
 // now we just find the relative position of the waypoint from the car transform,
 // that way we can determine how far to the left and right the waypoint is.
 var RelativeWaypointPosition : Vector3 = transform.InverseTransformPoint( Vector3( 
            waypoints[currentWaypoint].position.x, 
            transform.position.y, 
            waypoints[currentWaypoint].position.z ) );                    
 
 
 // by dividing the horizontal position by the magnitude, we get a decimal percentage of the turn angle that we can use to drive the wheels
 inputSteer = RelativeWaypointPosition.x / RelativeWaypointPosition.magnitude; 
 
 
 // now we do the same for torque, but make sure that it doesn't apply any engine torque when going around a sharp turn...
 if ( Mathf.Abs( inputSteer ) <= 1.5 ) //< 0.5
 {
  inputTorque = RelativeWaypointPosition.z / RelativeWaypointPosition.magnitude - Mathf.Abs( inputSteer );
 
 
 }
 else
 {
  inputTorque = 0.0;
 }
 
 // this just checks if the car's position is near enough to a waypoint to count as passing it, if it is, then change the target waypoint to the
 // next in the list.
 if ( RelativeWaypointPosition.magnitude < 50 ) //20
 {
  currentWaypoint ++;  
 
  if ( currentWaypoint >= waypoints.length )
  {
   currentWaypoint = 0;
 
  }
 }
 
}

435517–15140–$AICar_Script.js (6.37 KB)

function NavigateTowardsWaypoint ()
{
------------
---------------------
------------------------------
------------------------------------
 
 
 
 
 
 // this just checks if the car's position is near enough to a waypoint to count as passing it, if it is, then change the target waypoint to the
 // next in the list.
 if ( RelativeWaypointPosition.magnitude < 50 ) //20 
 {     
  currentWaypoint ++;  
 
  if ( currentWaypoint >= waypoints.length )
  {
   currentWaypoint = 0;   
  }  
  /*
  if(EngineRPM <= 1)//EngineRPM <= 2
  {
       //this.transform.rotation = Quaternion.identity;  
             transform.localRotation = Quaternion.identity; 
  }
  */
  /*
  if(CurrentGear <= 1)
  {     
     GetWaypoints();    
  }  
  */
  RollBack();
 }
 
} 
function RollBack()
{
     if(EngineRPM <= 1.0)//EngineRPM <= 2
 {  
  this.transform.rotation = Quaternion.identity;
  GetWaypoints ();
 
 }
}

I add this:

}
function RollBack()
{
if(EngineRPM <= 1.0)//EngineRPM <= 2
{
this.transform.rotation = Quaternion.identity;
GetWaypoints ();
}
}

The car AI returns to its normal possition, when reaching the first waypoint, (starting point). At this point, possition Z of waypoint.

Any tips?

Full project:
http://www.filefactory.com/file/b47hh43/n/Carproject.7z