How to make my 2.5 d aiming script work diagonal to? java script

so I made a java srcipt to make my char. aim/look in different directions, but I tried to make annother comand to make it lokk Diagon directions to, but i doesn’t work. the rest (loking up, left etc.)works
(sorry if I put this question i the wronge place, I’m new to Unity and scripting)

here is my script so far:

#pragma strict

var speed : float = 6.0;
var gravity : float = 20.0;

private var moveDirection : Vector3 = Vector3.zero;

function Update () {
var controller : CharacterController = GetComponent(CharacterController);
if (controller) {
moveDirection = Vector3(Input.GetAxis(“Horizontal”), 0,
Input.GetAxis(“Vertical”));
moveDirection *= speed;
}

**// this is the part that doesn't work:
if (Input.GetButton ("shootRight") && ("shootUp"))**
{
	transform.eulerAngles = Vector3 (0, 45, 0);
}
if (Input.GetButton("shootLeft"))
{
	transform.eulerAngles = Vector3 (0, -90, 0);
}
if (Input.GetButton("shootDown"))
{
	transform.eulerAngles = Vector3 (0, 180, 0);
}
if (Input.GetButton("shootRight"))
{
	transform.eulerAngles = Vector3 (0, 90, 0);
}
if (Input.GetButton("shootUp"))
{
	transform.eulerAngles = Vector3 (0, 0, 0);
}

if (Input.GetButton (“shootRight”) && (“shootUp”))**

what is this? did you mean:

if (Input.GetButton ("shootRight") && Input.GetButton("shootUp"))

That’s because all of your subsequent if-clauses will be run, even if your first one is true. Try using else-if’s instead.

And change the “Input.GetButton (“shootRight”) && (“shootUp”))” to “Input.GetButton(“shootRight”) && Input.GetButton(“shootUp”))”

if (Input.GetButton("shootRight") && Input.GetButton("shootUp"))
{
transform.eulerAngles = Vector3 (0, 45, 0);
}
else if (Input.GetButton("shootLeft"))
{
transform.eulerAngles = Vector3 (0, -90, 0);
}
else if (Input.GetButton("shootDown"))
{
transform.eulerAngles = Vector3 (0, 180, 0);
}
else if (Input.GetButton("shootRight"))
{
transform.eulerAngles = Vector3 (0, 90, 0);
}
else if (Input.GetButton("shootUp"))
{
transform.eulerAngles = Vector3 (0, 0, 0);
}

Or you could use return-statements, but that would hinder you from putting any more code in the function, after the controls. And it would probably be a lot more messy.