|
I am really frustrated, so much so that I am going to ask this last question and walk away from the computer and wait. I'm trying to use raycasts to get the current mouse position at a click. For now, I'm instantiating an object as a debugger. Here's my code:
Now, when I play the game, when I click, it instantiates the object right at the camera's position. What am I doing wrong? Any and all help appreciated. Elliot Bonneville
(comments are locked)
|
|
You say to instantiate at transform.position, which is the camera's position (I'm assuming your script is attached to the camera). You need to create a RaycastHit variable and use the position where the raycast actually hits.
That will still use the camera's rotation; probably you want to use Quaternion.identity instead. Thanks. I spent all night on that!
Mar 22 '10 at 06:52 PM
e.bonneville
Would give 20 votes... If I could!
Mar 22 '10 at 06:52 PM
e.bonneville
come on people! upvote it so it gets to 20!
Oct 24 '11 at 11:49 PM
Jibidiah
Wouldn't you say Eric5h5 has enough karma as it is? This is a pretty simple answer! I never get 20 upvotes for basic tutorials... T.T
Oct 24 '11 at 11:52 PM
syclamoth
I don't think that "having enough karma" is a good reason for not upvoting an answer if it deserves it. Not that this one particularly deserves it; it already has more than enough votes for what it is. Also, I'd discourage upvoting an answer as some sort of popularity contest. Just stick to upvoting answers if you find them helpful and don't take any other factors into consideration.
Oct 26 '11 at 02:42 AM
Eric5h5
(comments are locked)
|
