- Home /
GUI texture ? help please
i got a script to zoom the camera and i have a crosshair texture but i am having trouble getting the texture to go full screen on mouse click down heres the script its C#
using UnityEngine; using System.Collections;
public class NewBehaviourScript : MonoBehaviour { public float altFieldOfView = 10.0f;
void Update () {
if(Input.GetMouseButtonUp(1)) {
float temp = camera.fieldOfView;
camera.fieldOfView = altFieldOfView;
altFieldOfView = temp;
}
if(Input.GetMouseButtonDown(1)) {
float temp = camera.fieldOfView;
camera.fieldOfView = altFieldOfView;
altFieldOfView = temp;
}
}
}
If you're going to take boiler code from the answers to your other question, please try to understand what the code is doing. There. I've changed the code posted to something that is both formatted correctly and follows the intent of the original code, to swap the FOV when right mouse is held down and to reset it when it is released.
sorry about the code i had to go to work and i wanted to post it just before i left but thanks for fixing it i appreciate it
Your answer
Follow this Question
Related Questions
Crosshair Help 1 Answer
GUI Button not working...but the the script is correct... 2 Answers
(4.6 UI) How to set up a window with x buttons, with a scroll bar? 1 Answer
Scrolling Text 1 Answer
Button Turns Off and On Object 1 Answer