C# Gameobject Problem

What's wrong with the access to GameObject when using C# although I haven't tested using Javascript?

I've got an enemy character which will follow the player's path. the code is written below.

using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

public class EnemyCharacter : MonoBehaviour
{
    public GameObject player;
    public Transform[] path;

    public void Start()
    {
        //Get the Player Tag
    }

    public void FixedUpdate()
    {
        if (!player)
            return;

        print("Player Exist");
    }

}

I attached this script to my enemy character and run the Unity and I get 1700fps ... then I set the value "player" in the editor and then the framerate becomes less than 300 fps.. What's wrong with that??? Is that the Bug for Unity 3.0? I am using Unity3.0 beta 5...

It's hard to reasonably compare frame rates above 500 with anything. If your frame rate is above 500, you're probably not doing a lot.

Compared to just checking a reference for null, printing to the log is a relatively slow operation. That said, most operations are way slower than checking for null. Don't worry about logging: I doubt you'll see a noticeable effect if your game is running at a normal frame rate to begin with.

Because you're getting errors in the console, which you also failed to mention in your post. You can't do "!player" because "player" is not a boolean type. You need to use "`player == null`" instead.