C# function running when not called?

I have a function in one of my scripts that I am only calling on a button press but it seems to be running constantly on start. Here is a pastebin of my code using System.Collections;using System.Collections.Generic;using System.Linq; - Pastebin.com. I can’t find any places that might cause this.

It would be nice to know which function it is that’s causing your problems :slight_smile:

1 Like

And if you throw error from that function, the stack should show what called it.

1 Like

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

How to understand compiler and other errors and even fix them yourself:

https://discussions.unity.com/t/824586/8

Beyond that, here is how to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

That’s very clever, but so obvious. I’ll need to remember that.

You also get a stacktrace with a regular Debug.Log

1 Like