Move Object On User Touch

Discussion in 'How Can I...?' started by Akash Khatkale, Jul 27, 2017.

Tags:
  1. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
    How to move object (not the character) when i touch the screen ??
     
  2. Benfont

    Benfont Avid Boxer

    Joined:
    Sep 27, 2016
    Messages:
    277
    Likes Received:
    278
    1) Add an advance move to the object you want to move
    2) Go to the world UI, add a character button and set its function to "Component Action"
    3) Go back to the world and click again on the object's advance movement, and find the "event" that will trigger the advance movement
    4) set it to "Button - Character Button"

    I made a quick BB doc with what I just explained, let me know if this is what you were looking for.
    https://drive.google.com/open?id=0BxWP2SOEw49KNE53S3FJeENzVDg

    Good luck with your game,
    Jonathan
     
  3. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
    Hey
    It doesnt works. Your bbdoc also dosent seem to work
     
  4. Benfont

    Benfont Avid Boxer

    Joined:
    Sep 27, 2016
    Messages:
    277
    Likes Received:
    278
    what version of Buildbox are you using?
     
  5. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
  6. Benfont

    Benfont Avid Boxer

    Joined:
    Sep 27, 2016
    Messages:
    277
    Likes Received:
    278
    Akash Khatkale likes this.
  7. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
    Wow. Thank you so much. It works superb with 2.2.9
     
    Benfont likes this.
  8. Benfont

    Benfont Avid Boxer

    Joined:
    Sep 27, 2016
    Messages:
    277
    Likes Received:
    278
    Good to hear!
    Good luck with the game!
     
  9. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
    Hey sorry to bother you again. Instead of component action i have used switch button. But it doesnt seem to properly work. I have a platform and a wall. The wall should go up when character arrives so that to prevent hitting. Switch A will move the wall upwards and switch B will move the wall downwards. But sometimes switch B is triggered first and my wall moves downwards which cause overlapping of wall and platform images. Any solution??.
    Link to the video :
    Link to bbdoc : https://www.dropbox.com/s/6iej911xafgm4u0/issue1.bbdoc?dl=0
     
  10. Benfont

    Benfont Avid Boxer

    Joined:
    Sep 27, 2016
    Messages:
    277
    Likes Received:
    278
    I am not at home at the moment, but will have a look as soon as I can to your issue. cheers
     
  11. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
    Thanks. Hoping to see your reply early
     
  12. Benfont

    Benfont Avid Boxer

    Joined:
    Sep 27, 2016
    Messages:
    277
    Likes Received:
    278
    Hey there, I believe I found what the issue is - the switch button, switches from A to B and back every time is pressed. if your wall is already down and the switch button goes to B, then your wall is going to go down. this does not happen with the pyramids because they have a third movement which is down - below the platform (up, middle and down) but your walls have only two movements (up and down) / so when the wall is already down and you switch from A to B the wall is going to go through the platform. This can be solved by setting up a third movement for the wall just like the pyramids you have.
    I believe this is the issue, but I am not totally sure - give your walls a third movement and test to see if the problem is gone
    I hope this helps and sorry for taking so long to reply

    Have a nice day
    Jonathan
     
  13. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
    Hey
    How do i give third movement ? There is not switch C i guess
     
  14. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
    And sorry for the music in the video. I literally forgot to remove the music
     
  15. Akash Khatkale

    Akash Khatkale Boxer

    Joined:
    Sep 11, 2016
    Messages:
    72
    Likes Received:
    14
    Pyramids also have two movements- up and down. But it has the same problem like the walls. I want pyramids to go down and middle.. but it goes to up also. Same like wall. I want up and middle movement. But it goes to down also. You can try the bbdoc and suggest any changes
     
  16. Benfont

    Benfont Avid Boxer

    Joined:
    Sep 27, 2016
    Messages:
    277
    Likes Received:
    278
    oh ok, I thought that down movement of the pyramids was made on purpose - it actually suits the game and solves the problem. I don't think there is a problem in this case. What if you implement something like this to the walls too? so it doesn't look buggy.

    upload_2017-8-14_20-5-5.png

    I believe the whole issue happens because when you press the switch button it affects all of the assets that are rendered at the moment (even if they are not on screen) so when they finally appear on the scene the are already down. I am not sure how else can I explain it, maybe if you don't think this answer is the best you can try sending the bbdoc to support@buildbox.com and see what they say.
    I hope I helped you in the end,
    Cheers
     
    meremy likes this.
  17. Phoebe

    Phoebe Serious Boxer

    Joined:
    Aug 9, 2016
    Messages:
    667
    Likes Received:
    392
    I have test your BBDOC on my Smartphone dont work :( i have the Problem with a new game i want to use advance move object with character button but it doesnt work on my Phones :(
     

Share This Page