C# speed bug on translate
Hi all. I'm having an issue with this line of code.
player.transform.Translate (v, 0, 0 Speed Time.deltaTime);
My player is stuck on an insanely fast speed that ignores the speed and time.delta in the code. The speed is public. There seems to be no difference whether it is changed in script or in the inspector. I've checked around and a few others have this same issue, but no solutions. Is there something obvious to this or Is this a unity bug or something else? Any help would be appreciated.
not a problem with unity, that's for sure. please correct your code line since it won't compile even and is therefore not showing the actual problem is causing it.
Answer by GuySevern · Aug 28, 2015 at 12:23 AM
Sorry, i must have missed the code button
player.transform.Translate (v, 0, 0 * Speed * Time.deltaTime);
I've used this code before in another program and it works fine. The issue is with the speed variable not being adjustable even in the inspector. It's odd.
if you wanted to move along x it's the v variable not SPEED. the z value gets multiplied by 0 so the code there is not doing anything. my guess is it's just mixed up a bit ;)
Your answer
Follow this Question
Related Questions
Adjusting enemy speed 2 Answers
How do I stop transform.Translate using time? 2 Answers
Updated Accelerometer Calibration Solutions? 0 Answers
Can someone help me rewriting my script from transform.position to transform.Translate? 1 Answer
3D Player Controller Movement won't face it's head in the direction of the arrow key press 0 Answers