- Home /
This question was
closed Jan 08, 2014 at 08:40 PM by
ArkaneX for the following reason:
Duplicate Question
GetAxis main thread issues
So I'm working on half of a mouselook script. But I keep running into the error "GetAxis can only be executed in the main thread"
I've tried everything I can, stuff I've tried has a number next to it for reference.
#pragma strict
var mouseX = Input.GetAxis("Mouse X"); 1
var mouseX = Input.GetAxis("Mouse X") * Time.deltaTime; 2
function Start () {
var mouseX = Input.GetAxis("Mouse X"); 3
Screen.lockCursor = true;
}
function Update () {
var mouseXcompile = mouseX * Time.deltaTime; 4
transform.Rotate(mouseXcompile, 0, 0);
}
4 obviously isn't there when 2 is. If I do 3, I get tons of errors.
Comment
Follow this Question
Related Questions
Coroutine Death on Scene Change 3 Answers
Threads and serial port Bluetooth devices 0 Answers
Why my Thread stop working when I call another class? 1 Answer
How does a thread work in a distributed environment? 0 Answers
C++ Callback in another thread 1 Answer