First of all, I'm talking about SetPass calls, which I understand are draw calls.
I have an empty GameObject that I use as a Camera target in my game. I've positioned it above my character and when it reaches x height the camera moves up.
With the Camera target enabled, I get about 60 SetPass calls. When I disable it, I get around 30.
Why does this simple object produce so many SetPass calls?
Here's the screenshot with empty GameObject enabled:
Here's the screenshot without GameObject enabled:
Here is the empty GameObject:
This is where I reference the empty GameObject(cameraTarget):
void FixedUpdate(){
if (cameraTarget != null){
if (cameraTarget.transform.position.y > thisTransform.position.y) {
thisTransform.position = new Vector3 (0, Mathf.SmoothDamp (thisTransform.position.y, cameraTarget.transform.position.y, ref velocity.y, smoothTime), 0);
}
}
}
When I disable the empty GameObject during gameplay my game runs fine and the camera still follows the empty GameObject even though it's disabled and I'm getting way less SetPass calls... weird.
EDIT:
The label icon attached to my Empty GameObject was causing the increase in draw calls:
EDIT:
I disabled the "Gizmos" in the Game window and it has removed draw calls across all of my scenes. I guess it's only an issue when running a game in the Editor.