When trying to instantiate a projectile prefab, I called a method from another script and it gave me this error, but neither the method nor the values input into it are static, does anyone know why this is happening?
Method I’m trying to call:
public void SpawnGameObject(Vector3 position)
{
Instantiate(spawnProjectile, position, Quaternion.identity);
rb.AddForce(new Vector2(0, projectileSpeed));
}
Code calling the method:
if(Input.GetMouseButton(0) && shotCD <= 0)
{
SpawnProjectile.SpawnGameObject(transform.position);
shotCD = startShotCD;
}
Any help is greatly appreciated :)