Quantcast
Channel: Answers by "Narv"
Viewing all articles
Browse latest Browse all 60

Answer by Narv

$
0
0
I assume you want the spotlight to follow your mouse cursor on the floor or ground, correct? if so, look up the function ScreenPointToRay() in Camera.. also Physics.Raycast. You will get a ray from ScreenPointToRay and then do a raycast and find the RaycastHit point and then that would be the point in world space that the spotlight would shine . Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if(Physics.Raycast(ray, out hit) { // make the spotlight do whatever using hit.point }

Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>