Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: serenefox on October 01, 2015, 10:03:47 PM

Title: Creating wind with add force and input touches
Post by: serenefox on October 01, 2015, 10:03:47 PM
Hello,

If anyone could help me out with this I would be very grateful.

I am trying to take a "swipe" direction and apply force in the direction of the swipe on a game object. The game object is supposed to be simulating a feather like object (I am also using a quad as a mesh for testing purposes with a rigid body). I have the "input touches" plugin and the associated playmaker actions. Here is basically what I keep coming back too:

I have the first state as a listener waiting for the "swipe" input, I captured the following variables:

Direction
Duration
Speed

Then I think I have to find the magnitude(I believe) from the speed and duration(or the start and end of the swipe, not sure) but I can't figure out how. Even if I did how would I apply force in the specific direction based on the direction values with the speed of the swipe?

So I have been trying to do this pretty much all day with little luck. As you can see I am at a loss. I am trying to basically move the game object as if it were a feather and the finger was wind force pushing it. I am working in the X and Y axis as if it were a 2d game for unrelated reasons but I'm not sure that is an issue. But it's 3d.

Any tips?