Posts | ||
---|---|---|
Can anyone help me with some Javascript & Unity? | Locked | |
Thread Options | ||
Jun 2 2014 Anchor | ||
So I have a spotlight but I need it to stay in one place - on the ground.Whilst the beam (the end) needs to follow and point at the mouse. I have absolutely no idea how to do this. So the beam kind of needs to rotate around an anchor at it's source. All I can find is how to make the light follow the mouse at its source. Rather than just the beam facing the mouse. Thanks guys |
||
Nov 2 2014 Anchor | ||
You need to do a raycast from the screen, passing through the position of the mouse, this will get the position in the game that the mouse is hovering over |
||
Feb 1 2015 Anchor | ||
Do a Raycast from player(Main camera) to the center of screen (where the player is looking at) and store that Vector as a Variable and use it on the torch as "Look at variable(Name of variable you stored the Vector of the ray). If you're not familiar with Raycast look into the documentation. |
||
Mar 29 2015 Anchor | ||
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.