using System.Collections.Generic;
using UnityEngine;
public class shooting1 : MonoBehaviour
{
public Transform FirePoint;
public GameObject bulletPrefab;
public float bulletForce = 20f;
// Update is called once per frame
void Update()
{
if(Input.GetButtonDown("Fire1"))
{
Shoot();
}
}
void Shoot()
{
GameObject Bullet = Instantiate(bulletPrefab, FirePoint.position, FirePoint.rotation);
Rigidbody2D rb = Bullet.GetComponent<Rigidbody2D>();
rb addForce(FirePoint.up * bulletForce, ForceMode2D.Impulse);
}
}```
It says its after impulse (30,68)
#Identifier expected
1 messages · Page 1 of 1 (latest)
You're missing the . in rb.AddForce
!ide
💡 IDE Configuration
If your IDE is not autocompleting code
or underlining errors, please configure it:
• Visual Studio (Installed via Unity Hub)
• Visual Studio (Installed manually)
• VS Code*
• JetBrains Rider
• Other/None
*VS Code's debugger plugin is unsupported.
We recommend using VS or Rider instead.
also seems like your IDE is probably not configured if you're having that issue so please configure it^