Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Mouse button problem
Topic Started: Jul 14 2006, 09:43 PM (439 Views)
-
Unregistered

I have started to make fps game, but I have problem with shooting. Sometimes when I hold mouse button down and jump same time, shooting stay on even if release mouse button.
I use same code as DemoEdit.zip:

if(MouseCheckButton(mb_left))
if(wait=0){
wait=6;
shootid=instance_create(x,y,shoot);
shootid.z=z+height;}
if(wait>0)
wait-=1;
Quote Post Goto Top
 
Xeniczone
Elite Member
[ *  *  *  * ]
I don't think this has to do with U3d, but have you tried a global mouse check. What that is saying is if you click that object if you used a global mouse check it will say if you click anywhere.

You can find the accual code by looking in the help.
Posted ImageComcast sucks!Posted Image
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Try using keyboard_check_direct instead of MouseCheckButton.
Offline Profile Quote Post Goto Top
 
Evolver
Member Avatar
Advanced Member
[ *  *  * ]
Dr. Best
Jul 15 2006, 05:05 PM
Try using keyboard_check_direct instead of MouseCheckButton.

Isn't that for keyboard? I have same problem.
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
No, this particular function works for the mouse as well as for the keyboard.

Is there maybe some variable used for two different things?
Offline Profile Quote Post Goto Top
 
Xeniczone
Elite Member
[ *  *  *  * ]
Quote:
 
keyboard_check_direct(key) Returns whether the key with the particular keycode is pressed by checking the hardware directly. The result is independent of which application has focus. It allows for a few more checks. In particular you can use keycodes vk_lshift, vk_lcontrol, vk_lalt, vk_rshift, vk_rcontrol and vk_ralt to check whether the left or right shift, control or alt key is pressed.
Posted ImageComcast sucks!Posted Image
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Just believe in me, it works (at least in GM5).
Or if you don't believe it just try it. Start some Game Maker project in the debug mode (F6) and add these two expressions:
keyboard_check_direct(mb_left)
keyboard_check_direct(mb_right)
And see what happens if you press a mouse button.
Offline Profile Quote Post Goto Top
 
Evolver
Member Avatar
Advanced Member
[ *  *  * ]
Thanks, it works.
:thumb_up:
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply