So Im currently trying building a 2.5D Online Multiplayer Game kinda like SuperSmash. Im using the Unity Multiplayer:Intermediate corse to do so. But I ran into a bit of a snag. I am successfully able to Instantiate a projectile on the side my player is facing. However, the projectile itself does not rotate and does not move like its supposed unless i hardcode a number into either the vector2 or vector3. Here is my code if anyone has any suggestions that would be great.
[Command] private void CmdSpawnProjectile()
{
GameObject projectile = Instantiate(projectilePrefab, muzzle.position, Quaternion.identity);
projectile.GetComponent().velocity = new
Vector2(muzzle.transform.rotation.x*projectileSpeed,0);
// this will not allow my projectile to move at all or rotate.
// it works if i just do vector2(20,0) but still doesn’t rotate or move the correct direction.
}