The problem that I am experiencing is that whenever I try to instantiate a bullet, the game pauses and I get this error: “InvalidCastException: Cannot cast from source type to destination type.
SpaceShipShoot.Update () (at Assets/Scripts/Level2/SpaceShipShoot.cs:28)”.
I have made bullet shoots before, but now that I am making it with a Rigidbody 2D this problem is happening, any ideas?
Instantiate part of code:
Rigidbody2D clone;
clone = (Rigidbody2D)Instantiate(bullet, heroShip.transform.position, Quaternion.identity);
clone.velocity = Vector2.right * bulletSpeed;