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...