Im trying to loop through an array of Trail Renders (length: 2), but it does not loop and only runs once, so only 1 trail render gets enabled...
In c#, unity 3D
Code: '''
TrailRenderer[] AllTrails;
private void Start()
{
AllTrails = DriftingParticels.GetComponentsInChildren();
}
public void Update()
{
GetInput();
HandelMotors();
HandelSteering();
UpdateWeels();
CheckDrifting();
DriftOrNot();
}
private void DriftOrNot()
{
foreach (TrailRenderer child in AllTrails)
{
child.emitting = true;
}
}
'''
↧