fork download
  1. [SerializeField] private GameObject bullet_prefab;
  2. Rigidbody2D rb;
  3.  
  4. void Start()
  5. {
  6. rb = bullet_prefab.GetComponent<Rigidbody2D>();
  7.  
  8. InvokeRepeating("addBull",0,1f);
  9. }
  10.  
  11. void Update()
  12. {//bullet_prefabのスピード制限
  13. rb.velocity = Vector2.ClampMagnitude(rb.velocity, 2);
  14. }
  15.  
  16. void addBull()
  17. {
  18. Instantiate(bullet_prefab, new Vector3(0, 0, 0), Quaternion.identity);
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,29): error CS1525: Unexpected symbol `GameObject', expecting `class', `delegate', `enum', `interface', `partial', `ref', or `struct'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty