Yay! another whole day spent trying to code and absolutely nothing to show for it…
I wish I could get past this and actually do some artistic stuff. I find coding no fun whatsoever, I’d much rather be pushing polygons…
Some help? Im trying to use 3 guitextures as 3 buttons to change a float value on another object. Hours of forum searching just seriously spins me out…
var object : Transform;
var RelevantTurnSpeed=100;
function OnMouseDown(){
var scriptVarible : float = object.GetComponent (SubSpeed).TheTurningSpeed;
scriptVarible=(RelevantTurnSpeed);
Debug.Log("buttonDown"+name);
}
So I’ve got 3 guitextures with this script on each. The public varibles for “relevant turnspeed” are set different in the inspector for each one.
Question1. Is the line directly under OnMouseDown ever going to work? I cant figure out if its working or not.
Question2. What would the code at the other end look like? I’ve tried :
private var TheTurningSpeed=1;
static var TheTurningSpeed=1;
and
(Public) var TheTurningSpeed=1;
To “Catch” the signal I’m sending, then I (hope to) use it in
rigidbody.AddTorque (Vector3.up* TheTurningSpeed* Input.GetAxis ("Mouse X"));
I cant seem to find a way to inset debug code to detect what part is failing, which makes things 100% guesswork.
I’ve got the subz game, I know its not great, but once I get SOMETHING that works I could use the concepts for a spaceship shooter or dragons breathing fire or whatever, and get out of these code gutters. The problem is different computers are behaving different and I think this is the last problem getting content to work across all speeds of machine…
Any advice would be welcome relief and would really cheer me up…
Thanks…
AaronC