Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Omninorm on March 13, 2019, 12:37:35 PM

Title: Do While MouseIsDown
Post by: Omninorm on March 13, 2019, 12:37:35 PM
I want the Player to continuously add Velocity to an object by holding down a mouse button, and  when lifting off the mouse button, it should stop. I have thought of doing it via a Boolean but this is not working out since I need to continuously check and then Playmaker throws a error.

I then found this but can't seem to find this video
https://hutonggames.com/playmakerforum/index.php?topic=20215.0

What I'm trying to do is a a rocket that adds velocity as the player presses the mouse and stop it when he doesn't

Any ideas on what seems to be simple, but the continuously adding the velocity is the issue. Obviously making it register a set velocity each time you click works fine.

Title: Re: Do While MouseIsDown
Post by: ch1ky3n on March 13, 2019, 02:06:19 PM
Get mousepick2d/ mousepick event

State1:
on mouse down > go state 2

state2
do stuff like add velocity but make sure to tick the every frame checkbox
on mouse up > go state 1

Title: Re: Do While MouseIsDown
Post by: Omninorm on March 15, 2019, 04:26:55 AM
Thanks for the help.
When adding It asks for collider2D.  I tried using Box Collider 2D and it does not trigger the event on MouseDown

I have obviously also tried clicking for Auto Adding.

(https://i.ibb.co/phky91f/Capture2.jpg) (https://ibb.co/J3SQMcv)