Hello!
i am a C# beginner and i have troubles with an angular shot.
i instantiate Bullets - zdirection works fine, but i get no angular Bullet (they are rotated correctly, but move straight)
i use Quaternion.Euler to rotate the Bullet.
Doesn´t “Vector3.forward” move the object always on the objects(local) zAxis?!
Player Script:
// **** Instantiate Bullet zdirection ****
Instantiate(Bullet_Prefab_02, transform.position + new Vector3(0.45f,0,0), Quaternion.identity);
// **** Instantiate angular Bullet ****
Instantiate(Bullet_Prefab_02, transform.position + new Vector3(0.45f,0,0), Quaternion.Euler(0,45,0));
Bullet Script:
void Update ()
{
float amountMove = BulletSpeed * Time.deltaTime;
myTransform.localPosition += Vector3.forward * amountMove;
if (myTransform.position.z > 6f)
Destroy(gameObject);
}