I’m trying to make a mouse controlled menu (move the cursor over an object and click to select). I tried putting a ray down from my fake cursor to detect which object it was over, but as often happens with ray sensors, it didn’t work. Any ideas about how to do this better?
Theres several mouse scripts been written to do that sort of thing. Search this forum for one of them.
Keith. 8)
I don’t think you understand… I have the script to copy mouse movement already, I just can’t figure out how to get it to detect which menu object the player is selecting.
you know there is a mouseover actuator?
turn the pulse mode on and it is relatively easy to tell when the user clicks on that particular object
(there are some limitations to it, I think the object must not be scaled [use control+a to apply the deformation to an object] or soemthing for it to work right)
Thanks I’ll try that
didn’t work.
Could someone make a demo file?
have you thought about the fact that when you are projecting your ray from your cursor it may be blocked by its own mesh.
Also, more likely, the fact that projecting a ray downward from your cursor will not line up with the object your trying to detect with the ray, because the view from the camera is not orthographic.
Try making the cursor object track the camera, for its orientation, so that when you project past the cursor it is in line with what you actually see behind it.
ITs a tough problem and if you fail to solve it i will send you a working example in a few weeks when i get my PC home from uni and can connect it to the net.
-Luke
i got a file that works, what your email?
sorry, it will be a while, i jsut checked the file and it now crashes blender
il re do it soon
Why not post the file? I also want to see how it works.
i dont have any web space
<edit> i use mouse over and have a plane in the back ground, each menu item when over sets a var to a number, when you click it tracks to another menu </edit>
<edit2> ok found out it works in 2.23 but not 2.25</edit2>
Making a RAY cursor track the camera! THAT’s GENIUS!.. never thought of doing that to keep the ray pointing at the right direction!!! i feel ashamed of myself…
thanx bright blender minds!
the trouble with that method is that the cursor would appear to move faster in the middle of the screen than it would at the edges - i think. :-? But there are scripts already out there that handle both mouse movement and mouseover objects. I use a modified version of the mouse_over.blend script that came with the demo200.zip or demo210.zip. I can’t release my modified version buyt I’m sure I’ve got a copy of the original at home if anyone wants it.
Keith. 8)
i just use the normal mouse cursor using;
import Rasterizer
Rasterizer.showMouse(1)
and it works fine
I’ve a question to the mouseover sensor. Is it possible that this sensor doesn’t work in the Windows Version of blender?
I’ve tested the sams script wih Linux but there are no problems…
noon
you have to be viewing from the camera for it to work.
hmm…
jep i’m viewing the scene trough the camera.
the object where i need the mouseover is the nearest, collision is activited but the face is invisible…