Touch Screen Controls not working but Keyboard Keys Are working

So, here is a dilemma that i am having. I have a racing car game going and the issue, is when i add the key boards keys to the controls it works perfectly fine. When i am adding the mouse/touch screens (I believe they are the same) it just does not work at all. Here is my setup:

Body (actor)
Left Wheel (actor)
Right Wheel (actor)

All of them are joined and constrained together so they move with the same motion. So if i press the right arrow on the keyboard all of them move in sync to the right.

But i am not sure why it is not working with touch. I have created 2 actors which are the forward and reverser buttons on screen and they are HUD. I have added that to both these attributes that

if mouse is pressed
DO
game.MoveRight is true
ELSE
game.MoveRight is false

and the same for the left but for the MoveLeft attribute.

I know i have to add the if game.MoveRight and game.MoveLeft rules too all 3 of the actors but when i do, they seem to not move, and when i take them out and use the keyboard keys they work.

Please can someone assist with this, because it will help me tremedously!!! Thanks in advance!!!

Comments

  • mounted88mounted88 Member Posts: 1,113
    Did you unlock the actors on the scene and made the changes in your prototype. You have to go to each actor on the scene and revert them back to prototype. When you unlock a actor on a scene and change the prototype, the changes won't take effect on the unlocked actors until you revert back to prototype.
  • DaGreatnessDaGreatness Member Posts: 82
    edited November 2013
    @mounted88 what do you mean revert back to prototype?

    I clicked on the actors on the screen - yes i did that and i made the changes to all 3 of the actors, but still there was no success, but when i add the keyboard keys it still works
  • mounted88mounted88 Member Posts: 1,113
    If you open a actor on the scene, the rule area will either be greyed out with a lock on it or it will be open to edit your rules. If it's opened to edit your rules then you either need to revert back to phototype or add the rules in that you need.

    It's better practice to just use the prototype actor and try not to unlock your actors in scene. But sometimes you have to anyways.
  • DaGreatnessDaGreatness Member Posts: 82
    @mounted88 yes i have unlocked them individually, and changed where it says

    receive key (right) to pressed

    by replacing that to

    if game.MoveRight is true (Which in this case its its referring to the actor that i had this setup where the mouse is being used)

    the only thing that is not working is, when i click on the actor block where the mouse action is coming from, i am not sure why its not working

    does that make any sense?


  • mounted88mounted88 Member Posts: 1,113
    Can you post a picture of how you have the rules set up in the actor?
  • DaGreatnessDaGreatness Member Posts: 82
    @mounted88 here is the link where you can download it

    http://www.sendspace.com/file/fj5nj5


    The DO parts work perfectly fine, they are not the issue, the issue is when I am trying to use the mouse down it works when I click on any where on the screen, its not pin pointed to that specific actor, I want it so when I click that actor it moves, and when I click the other actor it moves the other way, right now if I say if game.MoveLeft is true and game.MoveRight is true, it only reads as one thing, and the car wont move because when you click anywhere on the screen it trys to move both ways. Because the mouse is not defining the 2 actor buttons I have
  • mounted88mounted88 Member Posts: 1,113
    is your game.moveright a boolean attribute?
  • DaGreatnessDaGreatness Member Posts: 82
    @mounted88 yes both the game.MoveRight and game.MoveLeft attributes are Boolean attributes
  • DaGreatnessDaGreatness Member Posts: 82
    The thing I figured out is, that the touch feature or the mouse button feature works as one, meaning if I click the screen anywhere it moves it as one movement,like the keyboard you can define them like A and B which is clear so you can go forward and back, the touch needs to work as 2 different features too or attributes, in this case it's the touch is just referencing to just one, not sure why the 2 actors aren't working, which are forward and backward they aren't being define to read it as 2 different touch actors
  • allc1865allc1865 Member, PRO Posts: 777
    Are you touching an actual image on the screen or half of the screen? Is it a right image button or are you touching half the screen itself?
  • DaGreatnessDaGreatness Member Posts: 82
    edited November 2013
    @allc1865
    It's and going to be an image but for testing to get it right it's a block for now, the color is white for both, one is on the left screen side and one is on the right screen side like as the controls
  • allc1865allc1865 Member, PRO Posts: 777
    Here is a template for moving left and right. I hope this is what you're looking for. You can move the right box on the right side of the screen if that's what you what to do! ;) :)
    https://www.dropbox.com/s/r0k9xf7fe4atq52/move left & right.zip
    Hope this helps! :) ;) :)
  • DaGreatnessDaGreatness Member Posts: 82
    @allc1865

    I already have those attributes and everything setup. They are not working for some odd reason. That is why i have this thread open, setting up the variables was the easy part, i am not sure why it is not workin tho
  • mounted88mounted88 Member Posts: 1,113
    The picture you sent me was that the prototype actor rules or the unlocked actor rules? I couldn't tell because your using windows and I'm not familiar with windows creator. But I seen where it said revert towards the top of the rule set
  • allc1865allc1865 Member, PRO Posts: 777
    Will you send your project file so I can look at it please? ;)
  • DaGreatnessDaGreatness Member Posts: 82
    @mounted88 those were the actor rules not the prototype rules

    @allc1865 where should i send the file?
  • DaGreatnessDaGreatness Member Posts: 82
    @allc1865 and @mounted88 I FINALLY MANAGED TO FIGURE IT OUT, I HADD TO RECREATE THE ATTRIBUTES 30 times and it finally worked lollll, THANKS GUYS
  • mounted88mounted88 Member Posts: 1,113
    edited November 2013
    Well sorry I could fix nothing for y'all lol glad to hear you figured it out
  • allc1865allc1865 Member, PRO Posts: 777
    Okay glad you figured it out. Take care! :)
Sign In or Register to comment.