Improved traffic system
This commit is contained in:
@@ -19,8 +19,9 @@ func _process(delta):
|
||||
var xt = $VehicleBody.global_transform.affine_inverse()
|
||||
var loc = xt.xform(tgt)
|
||||
$VehicleBody.steering = clamp(loc.x, -1, 1)
|
||||
print(loc.x, " ", loc.z)
|
||||
print(loc.x, " ", loc.z, $VehicleBody.linear_velocity)
|
||||
$Camera.look_at($VehicleBody.global_transform.origin, Vector3.UP)
|
||||
print($VehicleBody.linear_velocity)
|
||||
match state:
|
||||
0:
|
||||
$VehicleBody.engine_force = 2000
|
||||
|
||||
Reference in New Issue
Block a user