how to check if mouse button is pressed

sefeloth

Veteran
Veteran
Joined
Oct 24, 2016
Messages
36
Reaction score
5
First Language
english
Primarily Uses
i could only find the code for if a key is pressed. how would i check if the player is holding down left click? how do i do that with right click? i want to make a skill in an abs that shoots a bullet as long as the player keeps holding down the mouse button
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
724
Reaction score
581
First Language
French
Primarily Uses
Here's a list of all script call equivalent of event commands, it's stickied somewhere on this forum.

Under input you can find:
Code:
(Input.isTriggered('ok'))
(Input.isRepeated(ok'))
(Input.isPressed('ok'))
(Input.isLongPressed('ok'))

(TouchInput.isTriggered())
(TouchInput.isRepeated())
(TouchInput.isPressed())
(TouchInput.isLongPressed())
(TouchInput.isCancelled())
(TouchInput.isMoved())
(TouchInput.isReleased())

The script call you're searching for is: "TouchInput.isPressed()".
 

sefeloth

Veteran
Veteran
Joined
Oct 24, 2016
Messages
36
Reaction score
5
First Language
english
Primarily Uses
thank you. (TouchInput.isPressed()) works to see if the player is still holding down the left click. but there is no function for that when holding down right click.

if(TouchInput.isCancelled()) will let me shoot 1 bullet when holding down right click but it doesnt continuosly do it like (TouchInput.isPressed()) for when holding down left click. is there a fix for this or a work around?
 

Latest Threads

Latest Posts

Latest Profile Posts


I ended up needing to do a chapter one world map remake. It's still WIP but coming along nicely. =D
Stream will be live shortly! I will be beginning a play-through of Resident Evil 4! Feel free to drop by!

1st iteration on castle interior in Tiled.
I've started up Pillars of Eternity. It's interesting how the game does a "select choice" cutscene using still image art for dramatic flair. I wonder if that might work for my RPGMaker project.
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.

Forum statistics

Threads
107,744
Messages
1,031,822
Members
139,883
Latest member
DeAngelis
Top