Assets\johnsa.cs(63,29): error CS0246: The type or namespace name ‘Bulletf’ could not be found (are you missing a using directive or an assembly reference?)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class johnsa : MonoBehaviour
{
public GameObject BulletPrefab;
public float Speed;
public float JumpForce;
private Rigidbody2D Rigidbody2D;
private Animator Animator;
private float horizontal;
private bool Grounded;
void Start()
{
Rigidbody2D = GetComponent();
Animator = GetComponent();
}
void Update()
{
horizontal = Input.GetAxisRaw(“Horizontal”);
if (horizontal < 0.0f) transform.localScale = new Vector3(-1.0f, 1.0f, 1.0f);
else if (horizontal > 0.0f) transform.localScale = new Vector3(1.0f, 1.0f);
Animator.SetBool(“running”, horizontal != 0.0f);
Debug.DrawRay(transform.position, Vector3.down * 0.1f, Color.red);
if (Physics2D.Raycast(transform.position, Vector3.down, 0.1f))
{
Grounded = true;
}
else Grounded = false;
if (Input.GetKeyDown(“w”) && Grounded)
{
Jump();
}
if (Input.GetKey(“space”))
Shoot();
}
private void Jump ()
{
Rigidbody2D.AddForce(Vector2.up * JumpForce);
}
private void Shoot()
{
Vector3 direction;
if (transform.localScale.x == 1.0f) direction = Vector2.right;
else direction = Vector3.left;
GameObject bullet = Instantiate(BulletPrefab, transform.position + direction * 0.1f, Quaternion.identity);
bullet.GetComponent().SetDirection(direction);
}
private void FixedUpdate()
{
Rigidbody2D.velocity = new Vector2(horizontal, Rigidbody2D.velocity.y);
}
}