Mouse Pointer in Screen and World Space! Mouse Picking in Unity! ✔️ 2021.1 | Game Dev Tutorial

Опубликовано: 03 Октябрь 2024
на канале: Ned Makes Games
10,988
282

✔️ Works in 2020.3 ➕ 2020.1

The mouse pointer is essential to almost all PC games. In this video, I show how to get it's position and work with it in screen, viewport, and world space, as well as how cameras affect these spaces. I also explore two ways to implement mouse picking, or how to tell if the pointer is over an object in the world.

👋 Subscribe for weekly game development videos!
► https://www.youtube.com/c/nedmakesgam...

👑 Join my Patreon for extra influence over topics, early access to videos, downloadable project files, and more!
►   / nedmakesgames  

🔗 Check out my website for a searchable list of tutorials!
► https://nedmakesgames.github.io

🔴 Twitch ►   / nedmakesgames  
🐦 Twitter ►   / nedmakesgames  
🎮 Discord ► https://discordapp.com/invite/ubxSVBK
📸 Instagram ►   / nedmakesgames  
👽 Reddit ►   / nedmakesgames  
🎶 TikTok ►   / nedmakesgames  
☕ Ko-fi ► https://ko-fi.com/nedmakesgames

💬 Video transcript
► https://docs.google.com/document/d/1P...

📚 Reference scripts
► https://gist.github.com/NedMakesGames...

⏲️ Timestamps:
0:00 Intro
0:11 Screen position
0:46 Viewport position
1:26 World position
2:54 Mouse over messages
3:31 Mouse over raycasts
4:01 Wrap up and credits

🎖️ Credits and references:
• MarkGX: Drag a GameObject with the mouse - https://answers.unity.com/questions/1...
• Astigmatic: Special Elite font - https://www.fontsquirrel.com/fonts/sp...
• trinter: LowPoly Mouse - https://www.cgtrader.com/free-3d-mode...

Music:
Bleeping Demo by Kevin MacLeod
Link: https://incompetech.filmmusic.io/song...
License: https://filmmusic.io/standard-license

#GameDev #IndieDev #Unity