- Home /
How do I define the SetCursor Script?
I am currently trying to add a cursor into my game and when I try to run it, the error: " 'Cursor' Does Not Contain a Definition for 'SetCursor'."
Answer by allenallenallen · May 28, 2017 at 02:46 PM
The problem lies in the name of your class. You called this script Cursor.cs which is why Cursor.SetCursor doesn't exist in this context. You aren't referring to Unity's Cursor API anymore, but your own script. To solve this problem, simply rename this script to something else like: GameCursor.cs
I did that, but nothing changed within the code. But Adding this: "public static void SetCursor(Texture2D texture, Vector2 hotspot, Cursor$$anonymous$$ode cursor$$anonymous$$ode);" seemed to help, but now the problem is that I've got to "declare a body because it's not marked Abstract, extern, or partial (CS0501)"
Your answer
Follow this Question
Related Questions
How Do I Lock the Cursor to the Center of the Screen? 1 Answer
How Can I Lock The Cursor Position? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How do I change the cursor without a separate Texture2D? 0 Answers