Trying to get this working for about 5 hours now, it’s currently 4:00AM and now I’m not playing around. Does anyone know how I can get this working?
I’m trying to make it so if the user clicks the text, it will bring them to another canvas, but it does nothing! (except make the text change color.)
BTW I’m not that advanced at scripting!
Here’s the script
var stXst = false;
var ftXft = true;
var tfXtf = false;
var mc = false;
public var cameratfc : Camera;
public var camerastc : Camera;
public var Mc : Camera;
public var Cc : Camera;
function Start()
{
renderer.material.color = Color.grey;
}
function OnMouseEnter()
{
renderer.material.color = Color.cyan;
}
function OnMouseExit()
{
renderer.material.color = Color.grey;
}
/*This is the part that doesn't work*/
function OnMouseUp()
{
if( ftXft )
{
camerastc.enabled = true;
cameratfc.enabled = false;
Mc.enabled = false;
Cc.enabled = false;
}
}
Please correct your post so that code is inside “CODE” tag and formatted. No one is going to read this mess.
Also You might want to use your thread title to describe your problem and not saying that you have one, we already know that. You wouldn’t be posting at all if you didn’t. It doesn’t help anyone searching for solution to similar problem either given it’s not descriptive at all.
EDIT:
OK, I’m a sucker and I read your mess after all. What is ftXft ? I don’t see any such variable being declared or defined anywhere.
First thing to do is to check that OnMouseUp() is being called. Debug or put Debug.Log inside of it.
EDIT:
You define your variables cameratfc, camerastc etc. but what are they? You never assign them any value so they don’t really correspond to anything in you scene like the actual camera.
When you play play then what you see depends on default camera in your scene. You want to change properties of that camera so you change them for variables cameratfc, camerastc etc. in your script. This variables however have nothing to do with the default camera in your scene. There’s no connection between them. You declare those variables but you never assign them values of any actual cameras in your scene.