How do I create a dead zone on "Thumbstick"?

Get help using Construct 2

Post » Sun Aug 28, 2016 4:37 pm

I've seen the few posts abut this but they are using the gamepad.

Right now when you touch the thumbstick the ship automatically moves/rotates, which makes it look weird. I'd like to have no ship movement when the thumbstick is 'touched', only when they thumbstick is not inside the dead zone.
I'm using custom movement with actions like these:

Touch - Is Touching Thumbstick -
System > angle(ThumbstickBase.X, ThumbstickBase.Y, Touch.XAt(thumbstickTouchIndex, "UI"), Touch.YAt(thumbstickTouchIndex, "UI"))
Player > 4*distance(ThumbstickBase.X,ThumbstickBase.Y,Thumbstick.X,Thumbstick.Y)


Image


Any help is greatly appreciated.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Sun Aug 28, 2016 7:11 pm

Add a condition to each event or as a parent event, compare two values - deadzonesize is less than distance(thumbstickbase.x,thumbstickbase.y,touch.x,touch.y.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Sun Aug 28, 2016 8:03 pm

Thanks for the reply.

Right now i'm trying to add that dead zone sprite underneath the thumbstick and on top of the thumb base, then add an "thumbstick overlapping" action, setting the ship speed to 0.

I'll try your way also to see which works best.

Thanks again.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112


Return to How do I....?

Who is online

Users browsing this forum: Iquerno, newt and 28 guests