I have an error that I am unable to figure out: rror CS0308: The non-generic method `UnityEngine.GameObject.GetComponent(System.Type)' cannot be used with the type arguments
Here is the code giving me grief:
public void Q1False ()
{
Q1FalseButton.SetActive (false);
Debug.Log ("False button clicked");
Q1B = true;
Debug.Log ("Q1B set to true");
Q1TrueButton.GetComponent (true);
Debug.Log ("True set to blink");
}
I've also tried replacing **GetComponent** with **AddComponent** with the same results.
BlinkEffect is essentially a .cs script attached to the UI and linked to the OnClick event of the False button. When the false button is clicked, I want the true button to start blinking, indicating the answer was actually True.
I know my code is probably laborious, but I am very new to scripting, coming from a design background, and I am trying to learn. I am reading the book: Learning C# Programming with Unity 3D, but the process is long, and I'm only on Chapter 3 - I've learned about ints, floats and doubles and the numbers they can handle and when to use them. But that doesn't help me with this problem.
I'm hoping someone with more knowledge than me could help me out and point me in the right direction.
I did find this article:
http://blogs.unity3d.com/2015/01/21/addcomponentstring-api-removal-in-unity-5-0/
but I don't completely understand how to use this information to fix my issue.
Please help.
Respectfully,
Kimber
↧