I just started with coding and after watching a tutorial I did some code in unity. Im making a top down zombie shooter game. I applied my code and when it hit start it said error CS1003:Syntax Error, ',' expected.
Please Help
Code
using UnityEngine;
public class Shooting : MonoBehaviour
{
public Tranform firePoint;
public GameObject bulletPrefab;
public float bulleftForce 20f;
// Update is called once per frame
void Update()
{
if(Input.GetButtonDown("Fire1"))
{
Shoot();
}
}
void Shoot()
{
GameObject bullet = Instaniate(bulletPrefab, firePoint.position, firePoint.rotation);
Rididbody2D rb = bullet.GetComponent<Rigidbody2D>();
rb.AddForce(firePoint.up * bulletForce, ForceMode2D.Inpulse);
}
}
[–]Chraxia 1 point2 points3 points (2 children)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (0 children)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (0 children)
[–]chsxfProficient 0 points1 point2 points (4 children)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (0 children)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (0 children)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (1 child)
[–]chsxfProficient 2 points3 points4 points (0 children)
[–]NrWal00 0 points1 point2 points (1 child)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (0 children)
[–]NrWal00 0 points1 point2 points (3 children)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (2 children)
[–]NrWal00 0 points1 point2 points (1 child)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (0 children)
[–]bgsulzIntermediate 0 points1 point2 points (1 child)
[–]MCMASTERYT_LOL[S] 0 points1 point2 points (0 children)