- Home /
Question by
SkyreGames · Jul 02, 2013 at 11:55 AM ·
raycastpointspotlightcenter
How to point Spotlight always to the center of screen(crosshair)
How can i center spotlight to center to avoid such as these situations? Can i use raycast hit for this?
spotlightpointtocrosshair.png
(159.6 kB)
spotlightpointtocrosshair.png
(258.8 kB)
Comment
You don't give enough information to understand the problem. If this is a flashlight in a first-person game, then you would make the light a child of the camera. If the light is fixed, but you want it to shine on object at the center of the screen, then you can use a Raycast() to find the point and Transform.LookAt() to point the light.