Can someone please explain me why my actor falls through the second cube? Thanks. https://www.dropbox.com/s/qobg3xl7kapl153/gravity.bbdoc?dl=0
I can tell you why but not the cause. If you put the game in debug mode you will see that when your character moves left or right the sphere collider doesn't move with it. That is your problem. Move the cubes to the centre and it does bounce off it. Something in your movement is not jelling with the physics and collider
Try this code instead of the one you have in Controls node: ----------------------------------------------------------------------------------------- var _speed; var _enabled = false; var _prev; var _target; var _phys; //----Standart function init(){ this.enableTouch(); _speed = this.attribute('Speed'); _phys = this.entity().physics(); } function update( dt ){ let x = this.entity().position().x; let delta = x - _target.x*0.02; let vel = _phys.linearVelocity(); vel.x = -delta*20; _phys.setLinearVelocity(vel.x, vel.y, vel.z); } function signal( name, value){ _enabled = value; } //----Move function move( point ){ if(_enabled){ let wp = this.scene().screenToWorld(point.x, point.y); _target = new Vec3((point.x-320)*_speed.x, 0, 0); } } component.move = move; //----Touches function touchBegan( point ){ this.move( point ); _prev = point; } component.touchBegan = touchBegan; function touchMove( point){ this.move( point ); _prev = point; } component.touchMove = touchMove; function touchEnded(){ } component.touchEnded = touchEnded; -----------------------------------------------------------------------------------------
https://www.dropbox.com/s/qobg3xl7kapl153/gravity.bbdoc?dl=0 ... maybe you could help me with a new problem.. I added a explosion to actortry when he gets defeated but buildbox crashes the moment my actor gets defeated. thanks
@imonedesign I use your node in a new project in the newest version of BB3. But I get the fail: " _target is undefined." Any ideas?