My Game Crashes

Discussion in 'Buildbox 3.0' started by keremcebi, Feb 16, 2019.

  1. keremcebi

    keremcebi Boxer

    Joined:
    Oct 3, 2018
    Messages:
    43
    Likes Received:
    0
    My game crashes even though it has no fps problems. It crashes after main character collides with other objects. There is a script that is executed after collision. Can it be main reason for it? Will there be performance stabilizations in next upgrades?

    here is the script





    var _speed;
    var _enabled = false;
    var _physics;
    var vel ;
    var pos;
    var speed;
    var speedY;
    var trail;
    var trailC;
    var score;

    function init(){

    _physics = this.entity().physics();
    if(_physics && _physics.type() != 'kDynamic'){
    _physics = null;
    }
    }
    function update( dt ){

    dt = 1/60.0; // fixed delta time

    if(_enabled){

    this.emitSignal('Sound',true)
    pos = this.entity().position();
    this.entity().physics().setAngularVelocity(-8,0,-5)
    this.entity().setTexture('Number 2')
    this.entity().setColor(59,0,134);
    speed = -1.70;
    speedY= 5;

    if(pos.z%1 < -0.5){

    if(pos.z%1> -0.7){

    speed -= 0.1



    }

    }

    if(pos.z%1<-0.1){

    if(pos.z%1>-0.5){

    speed += 0.1
    }
    }

    _physics.setLinearVelocity( 0, 10, speed);









    }

    }

    function signal( name, value){

    this.scene().addScoreCoin(1)



    _enabled = value;

    }
     
  2. Josh (Nology Games)

    Josh (Nology Games) Avid Boxer

    Joined:
    Nov 27, 2017
    Messages:
    200
    Likes Received:
    155
    A script can crash buildbox if something is wrong but I am not sure what it would be
     

Share This Page