Hello,
well i try to change a parameter in a C# Script that is attached to a GameObject via a MouseDown.
If i do it with javascript it works but then i can only access a other javascript parameter. But all is in C# and that’s where i run into problems…
Here is the Car.cs Script and i want to change accel via a other C# script.
void FixedUpdate () {
float accel = 0; // accelerating -1.0 .. 1.0
bool brake = false; // braking (true is brake)
if ((checkForActive == null) || checkForActive.active) {
steer = iPhoneInput.acceleration.y);
accel = (-iPhoneInput.acceleration.z);
and her is my MouseDown Script:
public class MouseDown : MonoBehaviour {
void FixedUpdate () {
if (Input.GetMouseButtonDown(0))
{
Car.accel = 1.0f;
//Application.OpenURL ("http://unity3d.com/");
}
}
}
If i use “OpenUrl” all works fine.
Maybe someone can give me a example. I have search the Forums and read all the Java Scrips and if i do a Test with .js it work but with C# it doesn’t.
many thxx