Adventure Example Movement

Discussion in 'How Can I...?' started by Malo, Mar 28, 2020.

  1. Malo

    Malo Boxer

    Joined:
    Jun 29, 2019
    Messages:
    5
    Likes Received:
    0
    Hello! I was wondering if anyone could help with this probably easy thing to do, but I am still in the process of learning a lot.

    Anyway, in the example project "Adventure", one can move the character by dragging on the virtual joystick. I want to make it so that the keyboard arrow keys can also do that, but I am having alot of trouble doing so. I see that there are default built-in logics that have the arrow keys with the keyboard, but I can't seem to figure out how to use them to be able to move the character like you can with the virtual joystick, but using the arrow keys. Guidance would be greatly appreciated. I'm attaching a pic but I don't know if its of use. [​IMG]
     

    Attached Files:

  2. Malo

    Malo Boxer

    Joined:
    Jun 29, 2019
    Messages:
    5
    Likes Received:
    0
    Can anyone help here, I'm sorry to reply to my own message, I just really feel this step might open new doors of understanding for other components related to controlling a character. Thank you so much in advance.
     
  3. Smart Penguins

    Smart Penguins Boxer

    Joined:
    Jan 2, 2020
    Messages:
    62
    Likes Received:
    70
    You'll have to create a script for that. The Adapter is what you are trying to make, add thous inputs and output.
    Here is the code:
    Code:
    let dir=new Vec3(0,0,0);
    
    function signal(name, value){
        if(name=='X'){
            dir.x=value;
        }else if(name=='Y'){
            dir.y=-value;
        }
        this.emitSignal('Output',dir);
    }
    

    Screen Shot 2020-03-30 at 8.24.59 PM.png
     
    dmc likes this.
  4. Malo

    Malo Boxer

    Joined:
    Jun 29, 2019
    Messages:
    5
    Likes Received:
    0
    Thank you so much!!! Can I ask one other thing? I downloaded the new beta
    Buildbox 3.2.0 Update and along with it the Free 3D Platformer Template. The movement here is also with a virtual joystick. The movement is sooo much more complicated than the one above. Can you give guidance on doing the same for that character? I tried to apply what you showed above but oh my there are so many nodes that I am just lost. I wish Buildbox would automatically generate a keyboard equivalent to the virtual joystick when it is used. But anyway, if it's too complicated to put here please let me know and I would understand. I think if you showed how to do that, it would strengthen the amount learned from it a great degree! I hope to hear from you even if you don't have the time to do it. Thanks!!!
     
  5. Malo

    Malo Boxer

    Joined:
    Jun 29, 2019
    Messages:
    5
    Likes Received:
    0
    Btw I tried to add what you told me to do and I'm getting a bunch of errors which I will paste here. btw, I also noticed that "Platform keyboard Controls" is at the bottom that was enabled. I'm not sure if they were useful or not. So here are the errors and you can see how I set it all up in the editor:
    [​IMG]
    [​IMG]
    I also changed the character to kinematic since the letter A and D and W and S would not go in opposite directions. I mean its a big mess. I'm not sure where to even start.

     

    Attached Files:

  6. Smart Penguins

    Smart Penguins Boxer

    Joined:
    Jan 2, 2020
    Messages:
    62
    Likes Received:
    70
    Here is how can set up keys for 3D Platformer


    For the other one, I'm not sure why you have those Move nodes?
     
    Malo likes this.
  7. Malo

    Malo Boxer

    Joined:
    Jun 29, 2019
    Messages:
    5
    Likes Received:
    0
    Thanks for the new tutorial its helping understand a lot. I think I had those because I had watched a different tutorial and got them mixed up in my head. But the new tutorial you put up is great, thanks so much.
     

Share This Page