Touch Controls

0 favourites
  • 11 posts
From the Asset Store
Supports keyboard, mouse and gamepads. Supports several gamepads at once.
  • Hey all,

    I'm trying to do a Touch Controls test. So what I've done is create direction objects to act as my on screen controller. I have Left arrow, Right arrow, and an Up arrow. They are each separate objects. I have a main character which has Platform behavior.

    My problem is I can't get the character to move once I turned off default controls. And yes touch is set to use mouse input. My code looks like this: When Touch is pressed on Left arrow character simulate 8 directional movement Left. My character doesn't move at all.

    My touch controls are setup on a different layer from the main game.

  • It would be helpful if you could share the capx. The logic you described is sound in theory. So without actually seeing what's happening it seems more like guess work to solve your problem.

    However the tutorials may already have a solution that is being over looked

    Ashley's tutorial

    PS.

    no wait. you can't mix movement behaviours without finite control. you can't use 8 Way control to use on Platform behaviour.

    Platform has it's simulte control, using 8way will not work on the platform behaviour. Don't mix them. Good luck

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried it the other way too without the 8 way control and it still didn't move my object.

  • You still haven't posted your capx then :P

  • Can't right now I'm at work :) Basically I created some direction arrows and I told it when my cursor touches the arrow to move or simulate movement in that direction. I made sure mouse touches were set to Yes.

  • Well, if you removed the 8Way directional control. Your

    IsTouching ArrowSpriteRight

    -> Player - Platform Section - Simulate Control "Right"

    and it's still not working. Then it sounds like your touch event is not firing.

  • That could be the problem....nothing was firing yesterday lol

  • Alright....how do I upload my file?

  • Well, playing with it I solved it...somehow the event sheet got deselected so no matter what I did the game didn't know what to do.

  • In the future I would advise you to use Chrome Console plugin you can add events in your code flow to make sure it's being called, also debug variables which is SOOOOO helpful!

  • In the future I would advise you to use scirra.com/forum/log-text-Objects-to-chrome-console_topic47859.html you can add events in your code flow to make sure it's being called, also debug variables which is SOOOOO helpful!

    Might be a little advanced for me, I'm a rookie

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