Null Error Please Help(((

Discussion in 'Buildbox General Discussion' started by Dermenjhi, Jun 4, 2020.

  1. Dermenjhi

    Dermenjhi Boxer

    Joined:
    Jun 4, 2020
    Messages:
    28
    Likes Received:
    2
    Hiii!!! Can someone PLEEEEEEEEASE help me with that : JS Error [asset: Main Hero, component: Defeat, line: 0] - TypeError: start is null / This appears when I collide with an enemy in my game. My Hero just need to die but it just stopps and I can see that error! Can someone explain what happening? I don't even have such block of code with 0 line :(((
     
  2. Dermenjhi

    Dermenjhi Boxer

    Joined:
    Jun 4, 2020
    Messages:
    28
    Likes Received:
    2
    Thank You All Guys♥♥♥
     
  3. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Do me a favor, go into your Defeat Node, click right hand corner of node, copy all of the code, paste it here so I can see it. Or post a link to your bbdoc file and I will gladly take a look.
    Sounds like something got inserted into your Defeat node code. And even easier, delete that Defeat node and replace it with a new one and try again.
     
  4. Dermenjhi

    Dermenjhi Boxer

    Joined:
    Jun 4, 2020
    Messages:
    28
    Likes Received:
    2
    Hi! Here is my defeat node code:

    //
    let remove;
    function init(){
    remove = this.attribute('Remove');
    }
    function update(dt) {
    }
    function signal(name, value) {
    if(value){
    this.emitSignal('Defeat', true);
    let start = this.entity().component('Start');
    start.setCreated(false);
    if(remove){
    this.entity().remove();
    }
    }
    }

    I think it's ok because I EVEN DEDN'T CHANGED it AND I saw same code in the examples of games and there it works nice. I tried to delete this and to create again but it's error still. I would try to publish the whole bbdoc file later but maybe you could understand sth now. Thank you so much man♥♥♥ The problem is that I DOING THE SAME as in example of a game BUT manually and it don't work. It's really strange cause I copied all that from a project that work I just added that defeat node and a collide with my hands and changed nothing. lol.
     
  5. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Your code looks fine. Something else going on. Would have to see your bbdoc file to understand.
     
  6. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    this error tells you that there is no node with that name so 'start' is null
    are you sure that your character start node name is 'Start'?
    considering the upper and lower case
     
    Last edited: Jun 4, 2020
    aminee likes this.
  7. Dermenjhi

    Dermenjhi Boxer

    Joined:
    Jun 4, 2020
    Messages:
    28
    Likes Received:
    2
    omg man THANK U soo much. It was so easy and I couldn't understand that. Ohh thank you!
     
    mohamed awad likes this.
  8. Dermenjhi

    Dermenjhi Boxer

    Joined:
    Jun 4, 2020
    Messages:
    28
    Likes Received:
    2
    Thank you very much, I found the solution! The problem was that in my code the name of hero was START but in fact it was named CUBE. So stupid flaw. Thank you ♥♥♥
     
  9. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    glad you did it
     

Share This Page