Hi guys, Im totally new on Visual studio and unity please help me! This is the code that i want to run on Unity and it shows this error message to me.
Assets/StepCounter.cs(10,13): error CS0246: The type or namespace name `Pedometer’ could not be found. Are you missing an assembly reference?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class StepCounter : MonoBehaviour
{
public Text stepText;
private Pedometer pedometer;
private void Start()
{
// Create a new pedometer
pedometer = new Pedometer(OnStep);
}
private void OnStep(int steps, double distance)
{
// Display the step count
stepText.text = steps.ToString();
}
}
Where is your class Pedometer defined? You still need a “using” statement (or to otherwise import it at runtime), even when it’s within the same project.
That’s assuming that you have defined such a class. If not, please do so! 