How to Make a 3D Object Follow the Mouse in Godot
Channel:
Subscribers:
3,830
Published on ● Video Link: https://www.youtube.com/watch?v=2DWKAqOZPXc
We go over 2 methods to make this work:
1. via a simple test of intersection with a Plane in Godot (not physics based)
2. via direct space state, so we can interact with physics bodies (like static bodies, character bodies too)
Code:
https://github.com/aimforbigfoot/NAD-LAB-Godot-Projects-4.0/tree/main/threedobjectfollowmouse
Timeline:
0:00 - Intro
0:06 - First method world setup
3:09 - Getting the intersection point for our defined plane
5:07 - First method working
5:26 - Second method world setup
6:00 - Setting up Physics-Based Intersection Point
7:03 - Making the Physics Ray Query Parameter 3D
8:50 - Making the world test PhysicsBody3D intersections with the mouse
10:20 - Second method working