fork download
  1. // Wheel.cs
  2.  
  3. public class Wheel : MonoBehaviour
  4. {
  5. [Range(0, 1)]
  6. public float forwardFriction = 1;
  7. public float sidewaysFriction = 1;
  8. }
  9.  
  10.  
  11. // Assist.cs
  12.  
  13. public class VehicleAssist : MonoBehaviour
  14. {
  15. void Start()
  16. {
  17. <...>
  18. }
  19.  
  20. void FixedUpdate()
  21. {
  22. if (drift)
  23. {
  24. var wheels = GameObject.FindGameObjectsWithTag("wheels");
  25.  
  26. foreach (var wheel in wheels)
  27. {
  28. wheel.GetComponent<Wheel>().sidewaysFriction = 9f;
  29. wheel.GetComponent<Wheel>().forwardFriction = 5f;
  30. }
  31. }
  32. }
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(17,8): error CS1525: Unexpected symbol `<'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty