|
I have a camera that's tilted downwards a little and looking at a terrain. I want to make a OnMouseOver script for the terrain. When the mouse moves over the terrain, it gets the position of the mouse over the terrain. Then it moves a waypoint to the mouse position on the terrain. This is not on mouse click, I want the waypoint to continuously follow the mouse as long as it's over the terrain. how would I do this?
(comments are locked)
|
|
See http://unity3d.com/support/documentation/ScriptReference/Collider.Raycast.html for example code. You would detect the hit point with raycast, and detect that the mouse is clicked, then instantiate (or move) a waypoint object to that position. not mouse click, mouse over. so raycast would be invalid
Oct 24 '11 at 09:06 PM
Jibidiah
Raycasting doesn't need clicking. It doesn't even need the mouse at all!
Oct 24 '11 at 11:01 PM
syclamoth
actually raycasting was exactly what I was looking for, I shall accept this answer.
Oct 24 '11 at 11:55 PM
Jibidiah
(comments are locked)
|
