Go Up And Down Stairs

Discussion in 'Buildbox 3.0' started by mmicoe, Mar 22, 2020.

  1. mmicoe

    mmicoe Avid Boxer

    Joined:
    Dec 20, 2016
    Messages:
    148
    Likes Received:
    41
    Hello,
    please I need an example about Character going up and down stairs!

    I need something like this tutorial, but it is in BB 2


    Any solution in BB3?

    All the best!
     
  2. mmicoe

    mmicoe Avid Boxer

    Joined:
    Dec 20, 2016
    Messages:
    148
    Likes Received:
    41
    Hello, I am in testing but I cannot find any solution!

    I am trying this but it does not working:
    1. Character is the red cube.
    2. Stair is the green rectangle: No physic
    stairs_1.png
    These are the stair properties:
    if stair collides with character send MSG
    stairs_2.png
    These are Character properties to stair up pressing UI Button Up
    To receiving MSG, Pressing button Move x:0 y:5 z:0
    Released button: Move: x:0 y:0 z:0
    stairs_3.png

    Issue:
    1. When character collides with stair (green rectangle) if button is pressed Character goes up fine!
    2. If Released button is pressed, character goes down. It is fine!
    3. But if character continues to climb, after character is not colliding with Stair(green rectangle), the character continue CLIMBING!! Wrong!
    If I button Released is pressed it does not work, and character goes up and climbing!

    After inserting a log in Move Script, it seems Move continuously is in update(dt) and button pressed is ever enabled.

    Is there any other solution?

    All the best!
    Mauro
     
  3. mmicoe

    mmicoe Avid Boxer

    Joined:
    Dec 20, 2016
    Messages:
    148
    Likes Received:
    41
    This is a provisory solution, but it's I think it's a slop!

    This is the green stair:
    If Collide with character signal is send TRUE
    If Collide with Character signal is send FALSE
    s1.png
    Now, if signal is TRUE, UI Button UP is activated Move up on pressed. On Released is Disabled.
    if signal is FALSE, UI Button UP activate Release signal.

    s2.png

    Script Move:
    function signal(name, value) {
    //Check the incoming signals
    this.emitSignal('Released', true);

    if (name == 'Enabled') {
    enabled = Math.abs(value) == 1;
    direction = value;
    }
    if (name == 'Dis') {
    enabled = Math.abs(value) == 0;
    direction = value;
    }
    }
    Now, character goes up while colliding green stair.

    I don't like this solution at all. Does anyone have a clean solution?
    Waiting an answer, please!

    Thank you!
    Mauro
     
  4. whitedogapp

    whitedogapp Avid Boxer

    Joined:
    Oct 8, 2015
    Messages:
    295
    Likes Received:
    72
    can u drop bbdoc??
     
  5. mmicoe

    mmicoe Avid Boxer

    Joined:
    Dec 20, 2016
    Messages:
    148
    Likes Received:
    41

Share This Page