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

0 favourites
  • 3 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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)

    Any help is greatly appreciated.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)