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.

Newcomers DBPro Corner / Is it poss to attatch limb to crosshair

Author
Message
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 27th Feb 2009 00:35
Hi,Can you control the limb with the mouse and how.

limb 1 = mx,my
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 27th Feb 2009 01:53
It would perhaps not be all that easy, but look up the command offset limb. That's the simple part. To get sort of an 3d mouse positioning effect, you'll have to read up on vectors.
(Do a forum search here, there are probably plenty of posts on this).

paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 27th Feb 2009 02:44
This runs but the limb dissapears

offset limb 1,32,mx,my,5
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 27th Feb 2009 04:51
We'd need to see more code then that to help you figure out the problem.

paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 27th Feb 2009 16:44 Edited at: 27th Feb 2009 16:45
Im aiming for the cross hair to have the limb attatched to it then use the intersect object command for firing mouse click,heres the code.



Also,are there any other tutorials on firing and aiming with the mouse not neccessarily using limbs?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 27th Feb 2009 16:49
in examples section


Example #0301 : Input Showcase

this show how to move a cross hair with joystick, work out how the joy bit works and replace it with mouse control.

Dark Physics makes any hot drink go cold.
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 27th Feb 2009 16:58 Edited at: 27th Feb 2009 18:47
Ive already got the mouse control over the cross-hair thanks,what im referring to is also having the limb attatched to the crosshair/mouse for a firng/aiming mechanism,or could you tell me the alternatives to a firing mechanism crosshair controlled by the mouse.Some tutorials would be great for a firng mechanism other than the tutorial where the aiming mechanism is aimed from the players rotation rather than by the mouse.
Many thanks.
edit-so near yet so far

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 28th Feb 2009 00:21
You could use the mouseX() and mouseY() positions as the 2d coordinates for pick screen.
You will also need to specify a distance to this command.
You will then be able to retrieve the position by using the get pick vector commands.

I'm not sure, but I think this could work


Hope that helps

paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 28th Feb 2009 21:03 Edited at: 1st Mar 2009 00:30
Many thanks,Ive searched and found the answer,simply centering the mouse and crosshair and rotating the camera simaultaneously.I have two easy questions,how do you centre the mouse and how do you rotate the camera with mouse control.

Login to post a reply

Server time is: 2024-09-28 02:22:35
Your offset time is: 2024-09-28 02:22:35