I'm a young beginner coder (I've signed in to this forum using my Dad's email) and I'm struggling to fix this error:
Assets\PipeSpawnerScript.cs(37,32): error CS1001: Identifier expected
**This is my code:**
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PipeSpawnerScript : MonoBehaviour
{
public GameObject pipe;
public float spawnRate = 2;
private float timer = 0;
// Start is called before the first frame update
void Start()
{
spawnPipe();
}
// Update is called once per frame
void Update()
{
if (timer < spawnRate)
{
timer = timer + Time.deltaTime;
}
else
{
spawnPipe();
timer = 0;
}
void spawnPipe();
Instantiate pipe, transform; } public Instantiate Transform { get => Transform1; set => Transform1 = value; }
public Instantiate Transform1 { get => Transform2; set => Transform2 = value; }
public Instantiate Transform2 { get => transform; set => transform = value; }
public Instantiate Transform3 { get => transform; set => transform = value; }
position(transform.rotation);
}
,I'm a young beginner coder struggling to solve the following error: Assets\PipeSpawnerScript.cs(37,32): error CS1001: Identifier expected.
My code is below, can anyone help?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PipeSpawnerScript : MonoBehaviour
{
public GameObject pipe;
public float spawnRate = 2;
private float timer = 0;
// Start is called before the first frame update
void Start()
{
spawnPipe();
}
// Update is called once per frame
void Update()
{
if (timer < spawnRate)
{
timer = timer + Time.deltaTime;
}
else
{
spawnPipe();
timer = 0;
}
void spawnPipe();
Instantiate pipe, transform; } public Instantiate Transform { get => Transform1; set => Transform1 = value; }
public Instantiate Transform1 { get => Transform2; set => Transform2 = value; }
public Instantiate Transform2 { get => transform; set => transform = value; }
public Instantiate Transform3 { get => transform; set => transform = value; }
position(transform.rotation);
}
↧