Help with Instantiate

I’m trying to understand what I’m doing wrong here.

When I try to use Instantiate (c#) I get an error with this code:

Using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
  public Transform prefab;
    
  Void CreateEntity(){
        Instantiate(prefab, new Vector3(2.0F, 0, 0), Quaternion.identity) as Transform;
       
  }

When I try to do this, unity kicks back a “error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement”

to make it work, I have to say Transform clone = Instantiate(prefab, new Vector3(2.0F, 0, 0), Quaternion.identity) as Transform;

This works, but I do get a warning about never using clone (well, duh, I didn’t want to have to use it anyway!!!)

Can anyone explain what I’m missing?

You have a capital V in void.

Also if you aren’t assigning the return value, get rid of “as Transform” and it will work.

i have got error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement

this is the error line:

initialTouch = t);