What can I do to get Unity to understand the Debug.Drawline command?
using UnityEngine;
using System.Collections;
public class Debug : MonoBehaviour
{
void Update()
{
if (Input.GetButtonDown("LightGreen_2"))
Debug.DrawLine(Vector3.zero, new Vector3(1, 0, 0), Color.red);
}
}
I am trying to make another version of Flow Free in 3D Unity, and got the script from Unity: Scripting API. Any advice? Thanks!
Answer by OncaLupe · Dec 24, 2015 at 05:05 AM
Next time, provide more information. Specifically what isn't happening that should be, or what is happening that shouldn't. And if you're getting any error, paste the exact (and full) error in your post. It will help reduce confusion and let people help you better.
Because of your limited info, I thought the issue was at first something else, but then just happened to notice what I believe is the actual problem. You named your class Debug
, but Debug
is a built in class in Unity. Solution: Don't name your class Debug
.
Your answer
Follow this Question
Related Questions
Movement Sticking 0 Answers
Find Normal Vector to BoxCollider 0 Answers
Telling the difference between a key press, double press and hold. 0 Answers
Lerp on the every 3 * n cycle does some wierd thing. 0 Answers
Jump OnCollision() Script not working 0 Answers