when i hit play in unity, i noticed that the bullets didn’t move. I looked at the variables from the inspector and they are still 0, even though in the other scrip they are 20. I changed the values from 0 to 20 manually for testing but they are still not moving. Then i also noticed that there is no checkmark for enabling or disabling. WTF is going on?! Here’s my scipt:
using UnityEngine;
public class BulletInfo : MonoBehaviour {
public int Damage, Speed;
public WeaponInfo Currentweapon;
//WeaponInfo is a script's name
public GameObject Camera;
void start()
{
//Get the Damage and speed that's already defined in the other script
Damage = Currentweapon.Damage;
Speed = Currentweapon.BulletSpeed;
}
void update()
{
//Move the bullet towards where the camera is facing
gameObject.GetComponent<Rigidbody>().AddForce(Camera.transform.forward * Speed);
}