I’m using Mindwave Plugin from the following link:
and I created a simple code to take the output EEG readings of the Neurosky headset to move the car forward, but whenever I run the game, the fps drops to 2fps
[SerializeField, Range(0.0f, 100.0f)]
[Tooltip("Player must hold its attention over this value to initialize car movement \"Focus phase\"")]
private float m_RequiredAttention = 10.0f;
private void Start()
{
Application.targetFrameRate = 30;
MindwaveManager.Instance.Controller.OnUpdateMindwaveData += OnUpdateMindwaveData;
}
public void OnUpdateMindwaveData(MindwaveDataModel _Data)
{
if (_Data.eSense.attention >= m_RequiredAttention)
{
// Make the car move forward
transform.position += transform.forward * 30 * Time.deltaTime;
}
}
Can anyone tell me what to do, it’s for my graduation project