I have noticed my rotating then I move is signifcantly faster in the web/mac versions than the PC.
So I want to sett a different speed depending on build type.
Is there a way to do this? like if(mac) var1 =x and if(PC) var1 = y sort of thing.
I have noticed my rotating then I move is signifcantly faster in the web/mac versions than the PC.
So I want to sett a different speed depending on build type.
Is there a way to do this? like if(mac) var1 =x and if(PC) var1 = y sort of thing.
From the Scripting API, you could use something akin to the following.
function Start () {
if (Application.platform == RuntimePlatform.WindowsPlayer)
print ("Do something special here!");
}
sweet thank you.
No worries, hope it helps take care of everything you need!
When you are rotating are you using delta time? Rotation and movement on any platform should happen at the same speed as long as you take time into account.
http://unity3d.com/support/documentation/ScriptReference/Time-deltaTime.html
If the speed of rotation is noticeably different on different builds/platforms, then that suggests either a bug in Unity or a problem with your code. (It shouldn’t be necessary to adjust the speed on a per-platform basis, I don’t believe.)
that is my code. It is clearly way faster on the mac.
Is that not how I should be doing it? (note the script only allows you to rotate if moving foward if you are wondering why that if was there)
Your movement is not framerate-independent; therefore, the speed of motion will likely differ depending on platform or build.
To make your movement more or less framerate-independent, multiply values such as movement speed by Time.deltaTime.
Also, note that this:
var forward = transform.TransformDirection(Vector3.forward);
Can simply be written as:
var forward = transform.forward;
so instead of transform.Rotate(0, Input.GetAxis (“Horizontal”) * rotateSpeed, 0);
should be
transform.Rotate(0, Input.GetAxis (“Horizontal”) * rotateSpeed * Time.deltaTime, 0);
?
Yes, that looks right.