Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Game Development

I'm getting an error message: "IsFinite(outDistanceForSort)" after adding the particles to the game.

After I added the Instantiate method call to the FlyPickup script to show the particle emitter, I started getting the following error message just after the particles disappear:

IsFinite(outDistanceForSort) UnityEngine.Camera:Render() UnityStandardAssets.Water.Water:OnWillRenderObject() (at Assets/Standard Assets/Environment/Water/Water/Scripts/Water.cs:108)

Any ideas how to fix this or what I may have done wrong? I checked my code several times and I don't see a problem. The error message repeats around 236 times and then stops. I say around because sometimes it's 235 or 237 or 238; but it's always in that range. The error message repeats every time the particles fade out. I added the PickupParticlesDestruction script and the errors only appear the one time.

The frog continues to move around as usual and the error message never returns but I'm thinking if I add the code to spawn additional flies that I'll get these errors after every fly is removed and the particle completes its display cycle.

Any help would be appreciated.

2 Answers

Arman Arutyunov
Arman Arutyunov
21,900 Points

I have exactly the same error but mine repeats 548 times. If you already have the solution please notify me.

My script

using UnityEngine;
using System.Collections;

public class PickupParticlesDestruction : MonoBehaviour {

    // Use this for initialization
    void Start () {
        //Destroy the pickup particles after 5 seconds
        Destroy (gameObject, 5f); 
    }


}

No, I never got a response and I didn't find anything to correct the problem.