How to change the cursor in Unity
Tutorial, Unity
0
How to change the cursor in Unity!
In this tutorial we will have a close look at the mouse. How to hide and show the cursor, and how to change the cursor sprite from a script.
♥ Subscribe to Oxmond Tutorials:
https://bit.ly/SubscribeOxmondTutorials
● Get the free Pixel Cursors here:
https://assetstore.unity.com/packages/2d/gui/icons/pixel-cursors-109256?aid=1100l4p9k
● Free Assets at the Unity Assets Store:
https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k
Script:
/* .-------. .--. .-------. .--. .--. .--. | |--.--.--------.-----.-----.--| | |_ _|--.--| |_.-----.----|__|---.-| |-----. | - |_ _| | _ | | _ | | | | | | _| _ | _| | _ | |__ --| |_______|__.__|__|__|__|_____|__|__|_____| |___| |_____|____|_____|__| |__|___._|__|_____| © 2019 OXMOND / www.oxmond.com */ using System.Collections; using System.Collections.Generic; using UnityEngine; public class Gem : MonoBehaviour { public Texture2D cursorArrow; public Texture2D cursorPickaxe; void Start() { // Cursor.visible = false; Cursor.SetCursor(cursorArrow, Vector2.zero, CursorMode.ForceSoftware); } void OnMouseEnter() { Cursor.SetCursor(cursorPickaxe, Vector2.zero, CursorMode.ForceSoftware); } void OnMouseExit() { Cursor.SetCursor(cursorArrow, Vector2.zero, CursorMode.ForceSoftware); } }
Tags In
beginner
change
cursor
cursor change
cursor sprite
cursor visible
development
game
hidden
hide
How To Change The Cursor In Unity
intermediate
learn
lesson
look
mouse
mouse look
Oxmond Unity Tutorials
sprite
stream
tutorial
tutorials
Unity
unity 2019
Unity3d
Unity3D 2019 Beginner Tutorial
video games
videos
visible
Related Posts
Leave a Reply Cancel reply
Tags
2D (12)
3D (5)
2018 (13)
2019 (17)
animation (7)
beginner (6)
beginners (13)
Beginner Tutorial - Unity 2019 (5)
button (4)
C# (21)
change (8)
coding (17)
coding pirates (28)
collision (3)
color (4)
control (5)
development (24)
effect (5)
game (27)
game making (11)
gameobject (4)
gameplay (4)
Hans Oxmond (17)
how to (15)
intermediate (5)
learn (17)
lesson (29)
material (3)
mouse (6)
object (6)
Oxmond Unity Tutorials (20)
script (4)
scripting (10)
scripting 2d (3)
shader (4)
sprite (7)
sprites (5)
tip (15)
tricks (5)
tutorial (17)
tutorials (21)
Unity (32)
Unity3d (29)
unity 2019 (7)
video games (17)