Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: frozze on August 10, 2014, 06:50:46 AM

Title: Restriction on drag axis
Post by: frozze on August 10, 2014, 06:50:46 AM
Hi.

I'm using finger gestures to drag a box. I can drag it everywhere on the screen. But what if i only want to drag it on the Y-axis? Can this be done with a playmaker action or something else?

Thanks
Title: Re: Restriction on drag axis
Post by: Lane on August 11, 2014, 10:55:40 AM
How do you have the drag setup? If you're injecting a vector3 position then just null the Z and X so only the Y comes through.
Title: Re: Restriction on drag axis
Post by: frozze on August 11, 2014, 11:49:31 AM
How do you have the drag setup? If you're injecting a vector3 position then just null the Z and X so only the Y comes through.

Hi Lane.

Thanks for your reply. I've attached my setup. I think it's vector 2, but I'm not sure.
Title: Re: Restriction on drag axis
Post by: Lane on August 11, 2014, 11:57:00 AM
Ah okay, so you're using an addon that doesn't expose the vector.

Hmm, well I don't know how elaborate it lets you control the drags since I haven't used Finger Gestures myself. My first thought if you're dragging game objects would be to get the position at the start of the drag (a vector3) and then try Set Position on the dragged object with the original vector every frame but only inject the axi that you want to freeze, leaving the other as null and letting FingerGestures have that axis to its control.

Might get artifacts this way, but its worth messing with if there isn't an option inside the addon to do it.
Title: Re: Restriction on drag axis
Post by: frozze on August 11, 2014, 05:11:18 PM
Ah okay, so you're using an addon that doesn't expose the vector.

Hmm, well I don't know how elaborate it lets you control the drags since I haven't used Finger Gestures myself. My first thought if you're dragging game objects would be to get the position at the start of the drag (a vector3) and then try Set Position on the dragged object with the original vector every frame but only inject the axi that you want to freeze, leaving the other as null and letting FingerGestures have that axis to its control.

Might get artifacts this way, but its worth messing with if there isn't an option inside the addon to do it.

Might be a stupid question, but how do you set it to null?
Title: Re: Restriction on drag axis
Post by: Lane on August 11, 2014, 05:13:40 PM
It might be called None. As long as it isn't zero, as that would .. make it zero, rather than ignoring it.