@KetraGames
  @KetraGames
Ketra Games | Selecting Objects in the 3D World with the Mouse Using Raycast (Unity Tutorial) @KetraGames | Uploaded November 2020 | Updated October 2024, 4 minutes ago.
In this Unity game development tutorial we're going to look at how we can select an object in the 3D world with the mouse by using Raycast.

If you prefer written instructions you can find a link to the text version here - ketra-games.com/2020/11/unity-game-tutorial-selecting-a-target-with-the-mouse.html

In this tutorial you'll learn how to create a Ray from the Camera to the position of the mouse cursor using the Camera.ScreenPointToRay method. You'll then learn how to cast this Ray using the Physics.Raycast method to determine which game object is under the mouse cursor. Finally, you'll use this information to fire a projectile at the selected target.

00:00 - Introduction
00:35 - Changing the colour of the game object when the mouse cursor is over it
02:18 - Using Raycast to determine which game object the mouse cursor is pointing at
04:29 - Firing the ball at the selected target by applying a force to a Rigidbody
05:26 - Testing our scene
Selecting Objects in the 3D World with the Mouse Using Raycast (Unity Tutorial)Rotating in the Direction of Movement 2D (Unity Tutorial)Editing Animations (Unity Tutorial)How to Create Custom Yield Instructions for Coroutines (Unity Tutorial)How to Hide the Cursor on the Unity Splash Screen (Unity Tutorial)How to Use a Seed Value to Recreate Procedurally Generated Levels | Unity TutorialAnimating Text - Star Wars Style (Unity Tutorial)Easily Create Different Enemy Types in Unity Using Prefab VariantsCreating a Third Person Camera (Unity Tutorial)How to Create 3D Moving Platforms (Unity Tutorial)Using Root Motion with a Character Controller (Unity Tutorial)Using Calculations to set Values (Unity Tip)

Selecting Objects in the 3D World with the Mouse Using Raycast (Unity Tutorial) @KetraGames

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER