transform could not be found

Hello all,
I have the following code :

using UnityEngine;
using System.Collections;
[RequireComponent(typeof(tk2dAnimatedSprite))]
[RequireComponent(typeof(PlayMakerFSM))]
public class NPC : MonoBehaviour
{
    bool isFollowingTarget = false;
    transform followTarget;
    
    void FollowTarget()
    {

    }
    void LerpingToFollowTarget()
    {

    }
}

The problem is that I get the following error :
Assets/Scripts/Characters/NPC.cs(8,5): error CS0246: The type or namespace name `transform’ could not be found. Are you missing a using directive or an assembly reference?
Does anyone have any ideea what this could be from ?

Regards

1 Answer

1

transform is a property to access the Transform component of the current Gameobject / Component.

Transform is the type (note the captial “T”)

thank you! that solved my problem.