Change Character position with animation

Discussion in 'How Can I...?' started by arif134, Apr 21, 2016.

  1. arif134

    arif134 Boxer

    Joined:
    Oct 8, 2015
    Messages:
    24
    Likes Received:
    4
    Hi

    I want to change the lane of my character car by tapping on the screen along with the animation. So on each tap the character will toggle the lane. Is it possible?

    Please find the screenshot.

    Thanks!
     

    Attached Files:

    • img.png
      img.png
      File size:
      18.6 KB
      Views:
      78
  2. convitza

    convitza Boxer

    Joined:
    Apr 4, 2016
    Messages:
    28
    Likes Received:
    8
    Hi, let me rotate your image a bit, so it's easier to understand.
    Take a look at my picture below, I come up with an idea:
    1. You need to put 2 invisible platform to block the car from falling out of the race.
    2. You need an action button to change the GamePlay: which I suggest is changing gravity of the world (how to add action button here).
    3. Now when you press on the action button, world gravity would switch from, for example,x:0-y:50 to x:0-y:-50
    --> This step make your character move up or down depends on how you setup the button setting.
    4. Change the game directions and adjust the gravity vector, x-y values, to fit your needs.
    That's my idea :)
     

    Attached Files:

    arif134 likes this.
  3. arif134

    arif134 Boxer

    Joined:
    Oct 8, 2015
    Messages:
    24
    Likes Received:
    4
    Hi, That's awesome. I have added two invisible collision objects at the side of the road. I've also added a Switch instead of a button to toggle the car movement. For car movement I've changed the linear velocity under "Advanced Move" section. This needs some fine tuning.

    I am also taking an idea from the Wall Jump template.

    Thanks for your help :)
     
    convitza likes this.
  4. arif134

    arif134 Boxer

    Joined:
    Oct 8, 2015
    Messages:
    24
    Likes Received:
    4
    Any idea what's the use of "Timeout" under Character's "Advanced Move" section?
     
  5. arif134

    arif134 Boxer

    Joined:
    Oct 8, 2015
    Messages:
    24
    Likes Received:
    4
    Here's the setting I did which saved me from adding 2 invisible platforms at the side of the roads. My game direction was -30 so I used the following formula to determine the linear velocity of my character. In my case the speed was 10.

    X = Speed * Cos(-30)
    Y = Speed * Sin(-30)

    I put these points in the linear velocity of my character and starts moving in game direction without any side collision support :)
     
  6. JoeWilson

    JoeWilson Avid Boxer

    Joined:
    Oct 8, 2015
    Messages:
    171
    Likes Received:
    65
    Wait you put trigonomic functions into buildbox? Or you just put the numeric result into buildbox?
     
  7. arif134

    arif134 Boxer

    Joined:
    Oct 8, 2015
    Messages:
    24
    Likes Received:
    4
    I calculated the values in Calculator and put the numeric result into buildbox :)
     
  8. tanvir8955

    tanvir8955 Avid Boxer

    Joined:
    Apr 26, 2016
    Messages:
    140
    Likes Received:
    76
    Arif I didn't get the part of "switch". Can you please elaborate? How did you switch your character from one lane to another by using only a single button?
     
    Last edited: Apr 26, 2016
  9. arif134

    arif134 Boxer

    Joined:
    Oct 8, 2015
    Messages:
    24
    Likes Received:
    4
    tanvir8955 likes this.
  10. tanvir8955

    tanvir8955 Avid Boxer

    Joined:
    Apr 26, 2016
    Messages:
    140
    Likes Received:
    76
    Thank you Arif for your reply. Is it available for free version?
     
  11. arif134

    arif134 Boxer

    Joined:
    Oct 8, 2015
    Messages:
    24
    Likes Received:
    4
    It's available in Buildbox 2.
     
    eyal likes this.
  12. eyal

    eyal Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    642
    Likes Received:
    121
    Hi @arif134 - question - I have placed one character goes right in the default animation. then I put another in the switch a and another in switch b but what happens is that upon switch always one of them stays. meaning 1 shows then 1+2 shows instead of just 2 and then 1 shows - what am I doing wrong ?
     
  13. tanvir8955

    tanvir8955 Avid Boxer

    Joined:
    Apr 26, 2016
    Messages:
    140
    Likes Received:
    76
    Dear @arif134, I used your above mentioned method for using angle for my character movement. It's working but the problem is it is taking longer time to change lane, I mean it's going to that movement direction but not abruptly but slowly. Any idea?
     
  14. arif134

    arif134 Boxer

    Joined:
    Oct 8, 2015
    Messages:
    24
    Likes Received:
    4
  15. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    927
    Likes Received:
    318

Share This Page