I am using Vector3.MoveTowards, i have a separate function that instantiates a gameObject and I want to move this, In the Update function i have an if statement,
void Update()
{
if (move == true)
{
DrewCard.transform.position = Vector3.MoveTowards(DrewCard.transform.position, pos + new Vector3((CardsInHand.Count - 1) * width + (width / 2), -63, 1), change);
}
But this does not work as "DrewCard" is not defined, when i define it using GameObject DrewCard;
It then says "NullReferenceException: Object reference not set to an instance of an object" Any ideas?