Wrong Wake Up Behavior?- It Only Works With Negative Pixel Distance

Discussion in 'Technical Discussion' started by JoaoPolido, Aug 21, 2018.

  1. JoaoPolido

    JoaoPolido Boxer

    Joined:
    Apr 23, 2018
    Messages:
    18
    Likes Received:
    4
    Hello there,

    Something is puzzling me, how to understand the wake up behavior :( can not make sense of it.

    On the image below you will see object "B" that needs to wake up when character "A" passes along vertically
    I tried many many times but it never worked -- it never awoke the object.
    The ONLY way I made it work was to add a negative pixel count, as in image I added -250 pixel as wake up distance, and it then woke up. But still the 250 pixels distance seems not respected, I would say when I am 400pixesl away it wakes it up.
    Thus I am lost, I can not make sense of this behavior ---- what is the logic of the wake up behavior?
    Am I counting pixels wrong way?
    Why it works with a negative pixel count?
    Is this is bug?
    Screen Shot 2018-08-21 at 17.51.18.png
     
  2. adrogdesigns

    adrogdesigns Avid Boxer

    Joined:
    Dec 5, 2016
    Messages:
    318
    Likes Received:
    233
    I think it has to do with your grid size.
    It maybe larger than a pixel size thus making it look like the distance is closer than it is?
    That’s my only thought it could be?
     
    JoaoPolido likes this.
  3. adrogdesigns

    adrogdesigns Avid Boxer

    Joined:
    Dec 5, 2016
    Messages:
    318
    Likes Received:
    233
    Oh and it has to be negative due to your game direction
    Your object is behind your character in that screenshot
     
    JoaoPolido likes this.
  4. JoaoPolido

    JoaoPolido Boxer

    Joined:
    Apr 23, 2018
    Messages:
    18
    Likes Received:
    4
    Thanks, still not fully understanding it. I will drop a line to support with the BB file if they can provide me some guidance on how to understand hte wake up logic vs character position, movement, connection to other objects ..etc.
     
  5. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    604
    Likes Received:
    360
    Hey there,

    I'm not 100% sure but as far as I know Wakeup Distance should be positive because every object has a circle base used for distance check. It's easier to check in a circle mode instead of a box (rectangle) mode. So to be more specific if you set the distance to be set on 10 pixel wide that will create a circle form with a range of 10 pixels from the center of that object so if player enters that circle the object will activate otherwise it will stay in place. You can use this as a base start for your projects or Commonly Asked Questions - How Can I...?

    I hope what I said will help you in some way.


    Best regards,
    Vlad
     
    JoaoPolido likes this.
  6. JoaoPolido

    JoaoPolido Boxer

    Joined:
    Apr 23, 2018
    Messages:
    18
    Likes Received:
    4
    Thanks Vlad, Yes I assume the wake up distance needs to be positive value, I have contacted support, it might be a bug as I am using 2.3.7 beta version.
     
  7. JoaoPolido

    JoaoPolido Boxer

    Joined:
    Apr 23, 2018
    Messages:
    18
    Likes Received:
    4
    Finally got to understand the wake up behavior; thanks Miko from Support team.

    For those you you out there, that might end up with same question, here o how it works;
    Set up:
    - game -90 direction, so vertical up direction.
    - character is coming from bottom of screen upwards
    - object is on the far end right side half way trough the screen border
    - object has a wake up distance of 1 pixel, (tried also with 250 and -250) all work.

    Distance is measured from the center of the object. Setting wake up to 1 means the object will wake when your character is 1 pixel away from the center of object. Imagine a horizontal line going through the center of your object. When your character gets 1 pixel close to this line, it will wake up. this is the most important part, as it means we get closer to that line and not closer to the object. Therefore with one pixel distance it means when I touch the line that is an horizontal line that crosses the object then it wakes up the object.

    : note: it might works differently on game direction "0" to the right platformer
     

Share This Page