Quantcast
Channel: Questions in topic: "loops"
Viewing all articles
Browse latest Browse all 184

Foreach loop not going through all the children

$
0
0
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; } } '''

Viewing all articles
Browse latest Browse all 184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>