Need Help with mouse movement

Ok so i want to make a simple game but stumbled upon a lil problem .:frowning:
So i have a cube that will be the caracter controlled by the player, a ball (i will update the shape) that will be the crosshair and a cannon(the blue object :D) that will move the same time with the cube. SO WHATS MY PROBLEM? YOU’D SAY! i need a script (or better a tutorial, cuz i:m quite new to te Game Engine) that will make the crosshair (ball) move using mouse movement and another one that will make the cannon rotate to the position of the crosshair(ball). Thanks in advance! Iattached my blend file…


Attachments

game.blend (432 KB)

Welcome to the forum.

All I can see is that you’re using Keyboard logic bricks on the main part and they’re working as they’re supposed to (it’s moving). So there’s no problem with that.
I think I know your problem and I have a solution: maybe you should spend some time searching Google, Youtube and these forums which contain more resources than you can imagine… :yes:

Crosshairs are implemented through overlay scenes (hint: Scene actuator). Here’s a tutorial. The reticle can either be a mesh or a simple plane with an alpha texture.

This is a tutorial for Mouselook with the script and everything.

I’ll see what it does…thanks for the response…

Sorry but that didnt helped… I want the crosshair(ball) to move up, down,left,right when you move the mouse. And the cannon to rotate to the direction of the ball…

Ok here’s what you should try.
I’ll write you a little Python script, because i fear this will get too complex with logic bricks.

this sounds awesome…thanks!

EDIT: oh…do you mean that i should use a python script? This i why I posted so someone give me or redirect me to the script… I do not have any knowledge of python programing

game (4).blend (469 KB) Try this

You are awesome man !!! Thank you so much !!!

Oh! one more problem. I can’t figure out how to make the cannon move with the character (cube) (just like the cannon would be mounted on the cube)! I tried to use logic brick but it keeps mooving to the ball position…
EDIT: I used a parent logic brick but when i rotate the cube the cannon isn’t pointing at the ball anymore… I stil want the cube to be able to do the same movement as in the original game.blend file…

delete post

Right-click the cannon to select it, press Shift and right-click the turret, press Ctrl-P to parent the cannon to the turret.

Click 3D on the trackto actuator

Thanks all for the help… agoose77’s trick with the 3D button did the trick…