How Can I Rotate An Object By Pressing A Button.

Discussion in 'How Can I...?' started by ShadowLabs, Dec 15, 2016.

  1. ShadowLabs

    ShadowLabs Boxer

    Joined:
    Dec 6, 2016
    Messages:
    54
    Likes Received:
    26
    How can i rotate more than 1 object at a time with a button. Thank you in advance.
     
  2. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    1. button connected to logic transform
    2. the button wakes up on collision set rotation to 300
    3. character steps over the button the button rotates with the transform
    4. transform rotation modifier is set to 20 with the objects name (you need two transforms in case of different objects name)
    5. transform rotates and collide with the objects to rotates them with 20
     
    deenasty likes this.
  3. ShadowLabs

    ShadowLabs Boxer

    Joined:
    Dec 6, 2016
    Messages:
    54
    Likes Received:
    26
    I was thinking like you click the button with a finger
     
  4. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    1. Add a character button to the ui set function to component action
    2. Select the object you want to rotate from the left panel (assets) add a advanced move component
    3. In step 2 set the rotation velocity to 60 and set the event to the button added in step 1
    try it
     
    deenasty likes this.
  5. Phoebe

    Phoebe Serious Boxer

    Joined:
    Aug 9, 2016
    Messages:
    667
    Likes Received:
    392

    Hi I hope this will help you. So you can also rotate objects
     
    Christoph likes this.
  6. ShadowLabs

    ShadowLabs Boxer

    Joined:
    Dec 6, 2016
    Messages:
    54
    Likes Received:
    26
  7. deenasty

    deenasty Boxer

    Joined:
    Nov 8, 2016
    Messages:
    42
    Likes Received:
    10
    There is an important step. The object type must be set to physics.
     
  8. otkat

    otkat Boxer

    Joined:
    May 31, 2016
    Messages:
    28
    Likes Received:
    1
    Hey guys!

    Can't make it work because of this: '3. In step 2 set the rotation velocity to 60 and set the event to the button added in step 1'

    Can you please explain where I an find 'the rotation velocity'? have searched all panel, can't find it (and checked the manual as well).

    Thanks
    Paul
     
  9. blad300

    blad300 Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    515
    Likes Received:
    276
    [​IMG]
     
    otkat likes this.
  10. otkat

    otkat Boxer

    Joined:
    May 31, 2016
    Messages:
    28
    Likes Received:
    1
    Thanks! However, when I set it to 60 (or both, tried various options), it starts to move right after the game starts and doesn't stop, so the button function is ignored.

    To make it simpler, here is what I want to do. I want an object to rotate (let's say 90 degrees) every time I press a button.
    thanks a lot!
     
  11. blad300

    blad300 Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    515
    Likes Received:
    276
    otkat likes this.
  12. otkat

    otkat Boxer

    Joined:
    May 31, 2016
    Messages:
    28
    Likes Received:
    1
    wow! that's exactly what I need. Do you mind uploading this file so I can see the exact settings?

    thanks,
    Paul
     
  13. blad300

    blad300 Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    515
    Likes Received:
    276
    Under video is also link to download the file man , you can give a like also :))
     
    otkat likes this.
  14. otkat

    otkat Boxer

    Joined:
    May 31, 2016
    Messages:
    28
    Likes Received:
    1
    ah, thanks. checked it.
    so here is what I've got. I want that triangular to move only when I press a button (right corner). However now it moves all the time.
    Also, I want it to move only 90 degree (or whatever number) and then stop, but it won't do it like that.
    Link: https://ufile.io/ox3gk
    if you ave any idea, would be glad to hear! thanks!
     
  15. blad300

    blad300 Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    515
    Likes Received:
    276
    Last edited: May 5, 2017
    otkat likes this.
  16. otkat

    otkat Boxer

    Joined:
    May 31, 2016
    Messages:
    28
    Likes Received:
    1
    thank you, man!

    have done this, but still not working for me for some reason. Anyway, thank you for you time! will be trying more!
    if you manage to implement it, please, let me know. would appreciate it a lot!
     
  17. blad300

    blad300 Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    515
    Likes Received:
    276
    otkat likes this.
  18. otkat

    otkat Boxer

    Joined:
    May 31, 2016
    Messages:
    28
    Likes Received:
    1
    yup, I sure did, but it didn't work for some reason and I also copied everything into my working file - still no results.

    If that helps, my goal is to be able to rotate in the same way as in the games (iOS) Tumball and Rotaball.

    thanks,
    Paul
     
  19. blad300

    blad300 Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    515
    Likes Received:
    276
    double check , should work, or message me with your project file to fix it for you
     
    otkat likes this.
  20. BugsKiller

    BugsKiller Boxer

    Joined:
    May 14, 2017
    Messages:
    2
    Likes Received:
    0
    Hi @blad300 ,
    Could you upload the attached file again? The old link is broken.
    I've tried to set angular velocity and timeout to rotate object by 90 degrees but still no success.
     

Share This Page