Bb3 Move Cube Left & Right With Touch

Discussion in 'Buildbox General Discussion' started by Phill Mason, Jul 28, 2018.

  1. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Hey there BB3 users, just finally getting the chance to play around with BB3 and I think I maybe missing the obvious, but I've watched all available videos and the help files too and still can get my simple cube character to move left and right when I touch the screen.

    I can attach a move node and get the character to start rolling forward (great) but also want to have hime move left and right on touch.

    Can someone please point me in the right direction as to which move node I need to use that has both left and right controls, it's driving me nuts, as I can only get him to go one way with move. Many thanks.
     
  2. jmiller8031

    jmiller8031 Avid Boxer

    Joined:
    Feb 23, 2018
    Messages:
    218
    Likes Received:
    82
    It's going to be the status quo to post an image of the node setup in question to be able to help people. There are too many variables that can effect the outcome of a particular setup. Can you kindly do that if my response doesn't work for you?

    In the mean time, you can try a Touch Move node if I understand what you want to do. Attach it to the Start node, separate from the Move node.You will want to change the number of the axis you wish to be able to move in. So left and right would be X axis.
     
    Last edited: Jul 28, 2018
    Phill Mason likes this.
  3. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Yup, good point @jmiller8031, uploading an image is a good idea at these early stages. I've been looking at a few of the presets to learn what nodes are being used for character movement, but nothing seems to be the same in my control options. I think perhaps some of them have been tweaked with Javascript.
    Here's a pic of one of the methods I've tried for simple left, right, character movement.
    Screen Shot 2018-07-28 at 20.58.59.png
     
    Phil H likes this.
  4. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Forgot to mention, that "Touch Move" sets a speed for the 3 axis, so as you mentioned, left and right would be on the X axis, but you would think BB would auto set this to a usable value, but the default 1 is just bonkers, it flies off the screen. I've set it to 0.25, but movement is ugly and jerky, so my guess is, it's not working properly just yet.
     
  5. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Looking at the "Leap" preset, this has the character left, right movement I was trying to achieve with the cube and the node labelled "Touch Move Ph" is a touch move node with some additional JS, so I think perhaps that answers my question. If you compare the JS to a fresh touch node, you'll see the code is different.

    Screen Shot 2018-07-28 at 21.23.37.png Screen Shot 2018-07-28 at 21.25.03.png
     
  6. jmiller8031

    jmiller8031 Avid Boxer

    Joined:
    Feb 23, 2018
    Messages:
    218
    Likes Received:
    82
    You're model scale is waaaaaay off if 1 is too fast. Look at the Fly preset. It uses Move and Touch Move in unison.
     
  7. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    The model is the preset red cube set at 0.25, so it shouldn't be way off at all. The fly preset has the correct movement I'm after, but once again, it uses a modded touch move node. So anyone like myself who doesn't know JS, cannot make a similar movement using the standard node. Hopefully this will change shortly.
     
  8. jmiller8031

    jmiller8031 Avid Boxer

    Joined:
    Feb 23, 2018
    Messages:
    218
    Likes Received:
    82
    My bad. You're right. Touch Move in Fly is using the Update function to smooth out the movement over time. You need to copy and paste that into what you want. The issue is that you need access to a way to control the speed of things over time and that is exactly what the Update function is. It is called every frame of the game as it plays. It's the perfect candidate to do movement speed math.

    If you're worried you'll miss anything important when you copy and paste parts of code you can just copy and paste the entire code in this instance. The underlying functionality of the node is the same and it was just slightly modified to work over a set amount of time.
     
    Phill Mason likes this.
  9. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    927
    Likes Received:
    318
    Hey a quick question ,Referring to screenshots above is Beta different for each subscription model ? Plus/Indie/Pro ?Because i couldn't find ifCollide,touch etc option/nodes as in screenshot.Am i missing something ?
     
    Phill Mason likes this.
  10. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Great to have a coder onboard @jmiller8031 :) I don't code myself, but want to learn JS, as the potential inside of BB3 alone, is hugely exciting for the future on our game development. I took a couple of screenshots of the code and did an A - B comparison to see what I could understand and I can see the differences, but don't yet fully understand what they're all trying to achieve.

    Can you recommend any good online resources, for learning the kind of JS required for BB3? I read that not all JS is equal and only certain parts would be useful in BB3.

    Thanks for the "Update Function" explanation, much appreciated.
     
  11. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    I don't know @TheGameAppStudio to be honest. I wouldn't have thought so. The 'ifCollide' and 'Touch' nodes are in the left menus after you've double clicked on Character/Actor. Here's a couple screenshots for clarity.
    Actor.png Touch & IfCollide.png
     
    TheGameAppStudio likes this.
  12. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    927
    Likes Received:
    318
    Hey :) Thanks for the insight .I was thinking since the launch of BB3 beta on how to add these functions without touch and jump option for a game and never cared to double click any object on left panel.I just kept bb3 aside and planned to look at it after few days :p Thank you once again and yes i too see those options now ;)
     
  13. jmiller8031

    jmiller8031 Avid Boxer

    Joined:
    Feb 23, 2018
    Messages:
    218
    Likes Received:
    82
    JavaScript.com is a decent resource from what I’ve seen. It’s owned by pluralsight and they are like a more professional version of Udemy. Just skip any web development stuff. You’re going to find a lot of web dev tutorials for JavaScript since it’s mainly used for that. You don’t need that knowledge for game development.
     
    Phill Mason likes this.
  14. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Cheers.
     

Share This Page