
Hi, G:<br />I tried to reproduce the bullet from the 2d(space_shooter demo) and apply it in 3d but I don't know,it's probably not the best solution... does anyone have any solution? Thanks, I think this is another useful thing for newbies.<br /><br />script:<br />
<br />
<br /><br /><br /><br /><br />
<br />extends Area<br /><br /><br />const SPEED = 850<br /><br />var hit = false<br /><br /><br />func _process(delta):<br /><br /><br />#Bullet speed/vector3??<br />func _ready():<br /> set_process(true)<br /><br /><br />func _hit_something():<br /> if (hit):<br /> return<br /> hit = true<br /> set_process(false)<br /> get_node("anim_splash").play("splash")<br /><br /><br />func _on_visibility_exit_screen():<br /> queue_free()<br /><br /><br />#Hit an Enemy<br />func _on_bullet_area_enter( area ):<br /> if (area.has_method("injure")):<br /> area.destroy()<br /> _hit_something()<br /><br /><br />#Hit walls,etc.<br />func _on_bullet_body_enter( body ):<br /> _hit_something()<br /><br />


Tagged:
Tags :
Comments