Mouse Follow
MouseFollow moves a Transform to the point in the world under the cursor. Use it as an aim target, for example for a Laser Guide or for a weapon that looks at the cursor.
Add Component: Glowing Rifts > Misc > Mouse Follow
⚙️ How It Works
Every frame it casts a ray from the main camera through the cursor:
- If the ray hits a collider on Follow Layer within 100 units, the target moves toward the hit point.
- Otherwise the target moves toward a point one unit in front of the camera, along the ray.
The move is smoothed by Speed. It reads the cursor from the Aim action of the package’s WeaponControls input.
📐 Inspector Overview
| Field | Description |
|---|---|
| Target | Transform that follows the cursor |
| Follow Layer | Layers the cursor can point at |
| Speed | How fast the Transform follows |
Note
It needs a camera tagged MainCamera in the scene.