Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / controll aim with mouse

Author
Message
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 17th May 2009 21:59 Edited at: 17th May 2009 22:20
ok i've searched the forums but didnt find anything helpful to newbies.

i've made a 3rd person camera but now i just need the camera's X and Y axis to be controlled by the mouse(like counterstrike, u can use keys to move and mouse to look and aim)

here is the code i have so far, i can't figure out the mouse so if u can figure it out, please post it so i can add it to mine then learn later on what it does and how it does it

attached is a screenie of what i looks like so far

Attachments

Login to view attachments
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 17th May 2009 22:29
Your left and right keys should not turn the object, but move it left and right. Then use the dbMouseMoveX and dbMouseMoveY to turn it:


thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 17th May 2009 23:01 Edited at: 18th May 2009 03:06
nice code, but now the mouse has waay too much controll,my player object turns as the mouse does, it can turn upsidedown and all dat, how can i make just the camera move?
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 18th May 2009 19:47
Maybe


thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 19th May 2009 03:20 Edited at: 19th May 2009 03:21
ok i used Mike's code for the 3rd person view, now i want the camera to snap to a certain position(the side of the objeect) when the mouse is clicked....this is sort of my battle mode, so everytime you left click to shoot, it goes there, then when you right click it goes back to the normal position


heres the code so far:

Login to post a reply

Server time is: 2024-10-01 01:18:31
Your offset time is: 2024-10-01 01:18:31