Mouse Movement?

I searched the forums for this, but couldnt really find anything. I need to make it capable for my game to, when you click the mouse, add an animated sphere where the mouse clicked, and the cube to go to the animated sphere. when the cube gets to the sphere, he stops, and the cube goes away. Oh also I need the sphere to always be on the ground so that the cube does not leave the ground. Im not sure whether you would need python for this or not, but I attached the .blend and all it needs is what I explained above.

Thanks

Attachments

Mouse.blend (154 KB)

I’m assuming you wanted the sphere to go away, and not the cube (because that makes more sense to me).

Example attached.

Attachments

Mouse_Social.blend (162 KB)

Lol yah thats what I meant… Thanks!

Oh also, how would I make it so that when you click, if you click again it will make the first sphere go away and the cube will move to the most recently clicked sphere?

In the PlaceSphere script rewrite the process part like this:


scene = GL.getCurrentScene() # this can be at the top of the script, under "import GameLogic as GL"

if click.positive and mouse.positive: 
    if "OBSphere" in scene.objects: 
        scene.objects["OBSphere"].endObject() 
    hit_pos = mouse.hitPosition 
    add.instantAddObject() 
    new_sphere = add.objectLastCreated 
    new_sphere.worldPosition = hit_pos 
    new_sphere.worldOrientation = [[1,0,0],[0,1,0],[0,0,1]] # Set orientation to normal

Lol yah thats what I meant… Thanks!
Heh, well, I’m glad I guessed right (ninja skills at work :cool:), but please, take the time to re-read your own post.

It will make things much easier for non-ninja folk. :smiley:

Well, at the time I was rushing to get this topic up and get to soccer game on time. Didnt have time to “Reread” But if “Non-ninja” folk cannot understand, than I will re-read! Haha!

Edit: Thanks so much Social!

This is what I’m wondering: “Does this guy want me to write his game for him?”.

Don’t be lazy. Experiment with the setup on your own; reduce the scene to its most basic working components, then add complexity until the system misbehaves.
^
When it does, you know that the last added part is causing the problem (this problem identification technique can be applied to more than just BGE problems).

I think right now we’re unsure what level of interest there is from consumers to really want a 3D experience in the living room. Many, many years from now when it becomes a reality

Sorry Social. Your right… Thanks for your help though!

Edit: Well, now I’ve got him to run and play the animation. So Thanks!