- Home /
tachometer??? Help!!
I need your help!!
i do a tachometer for a speed of a car!
this is the CarTacho.cs:
using UnityEngine;
using System.Collections;
public class CarTacho : MonoBehaviour {
public Texture2D tachoDisplay;
public Texture2D tachoPointer;
void OnGUI ()
{
GUI.Label(new Rect(10, 140, tachoDisplay.width, tachoDisplay.height), tachoDisplay);
GUIUtility.RotateAroundPivot(rigidbody.velocity.magnitude * 3.6f + 40,Vector2(70,70));
GUI.Label(new Rect(10, 140, tachoPointer.width, tachoPointer.height), tachoPointer);
}
}
The errors:
1 - Assets/Scripts/CarTacho.cs(12,87): error CS0119: Expression denotes a type', where a
variable', value' or
method group' was expected
2 - Assets/Scripts/CarTacho.cs(12,28): error CS1502: The best overloaded method match for UnityEngine.GUIUtility.RotateAroundPivot(float, UnityEngine.Vector2)' has some invalid arguments** 3 - **Assets/Scripts/CarTacho.cs(12,28): error CS1503: Argument
#2' cannot convert object' expression to type
UnityEngine.Vector2'
Can you help me?
Please i need your help!!
Answer by cregox · Apr 05, 2012 at 02:26 PM
try "`new` Vector2(70,70)
" there. the keyword here is new
. after that try reading way more examples on the docs.
Thanks! now there aren't any problem but... The pointer is invisible!?!!? there aren't the pointer!!!
Please help me to resolve this last problem!
You should have posted this as a comment on my answer. And it's never late enough to fix it! While you're at it, please give more details. $$anonymous$$aybe it's some issue with your textures? ;)
@Djandry Whoa, dude, chill! Don't worry, it's all gonna be good. There aren't the pointer you say? You forgotten to choose your textures in the Inspector?
@Djandry please let us know if and how you solved your issue? Or tell us what's still going wrong.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
unity c# RPC 0 Answers
How do I reference variables from one editor script in another 0 Answers