# changing car angle

## Recommended Posts

All is example.

How do you check if Car 1 is driving North, East, South, or West? I want Car 2's angle to be perpendicular to Car 1.

Like Car 1 is driving West, how to make Car 2 spawn with angle towards North/South, which is perpendicular?

##### Share on other sites

Try this out:

`:CAR_ANGLE_SETwait 00174: 0@ = car \$CAR_1 Z_angle 0174: 1@ = car \$CAR_2 Z_angle0085: 1@ = 0@ // (int) 1@ -= 90 // or 270 doesn't matter.end`

You can obviously change that to whatever you want and add it into your script. This stores the 1st car's angle to 0@ and 2nd car's angle to 1@ then takes 1@ and makes it the same integer or angle as 0@ and then takes 1@ (which is car 2's angle) and either takes it down by 90 or you can change it to 270 for the opposite direction.

Change the variables to your script's so you don't get mixed up.

##### Share on other sites

i'd make it this way:

`:CAR_ANGLE_SETwait 000A5: 0@ = create_car #PONY at 0.0 0.0 0.0  // car_1 = 0@0174: 1@ = car 0@ Z_angle // angle of car_1 is 1@00A5: 2@ = create_car #PONY at 0.0 0.0 0.0 // car_2 = 2@000F: 1@ -= 90.0 // or 270.0 This will substract 90 or 270 degrees from car_1's z_angle 0175: set_car 2@ Z_angle_to 1@ `

##### Share on other sites

How would you make that to a condition? To check what angle car 1 is.

##### Share on other sites

0174: \$HJ_CAR_ANGLE = car \$HJ_PLAYER_CAR Z_angle

##### Share on other sites

Can you just write a sample script where if Car 1 is driving Northeast, North, or Northwest, then Car 2 angle will be facing East?

And if Car 1 is driving Northeast, East, or Southeast, then Car 2 angle will be facing South?

##### Share on other sites

Nevermind, I got it. Thanks everyone.

## Create an account

Register a new account

×