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);
}