- Home /
Question by
evilrishabh · Sep 21, 2012 at 02:21 PM ·
carrespawnvehicleroad
respawn vehicle when goes away of road.
I am creating a car game And I want to respawn my vehicle when goes away of road . I want to respawn vehicle At same Rotation And position when it leaves the road . The vehicle respawn after 5 sec after leaving the road when it come to terrain.
Comment
when your vehicle leaves the road do this
positionWhenLeftRoad = vehicle.transform.position;
rotationWhenLeftRoad = vehicle.transform.rotation;
Invoke( "makeNewVehicle", 5.0 );
then, you write this function...
function makeNewVehicle()
{
use positionWhenLeftRoad and rotationWhenLeftRoad
as the position, rotation of your new vehicle.
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613081317im_/https://answers.unity.com/themes/thub/images/avi.jpg)