bullet physics seem better, need to figure out collisions and collision points
This commit is contained in:
@@ -21,7 +21,7 @@ var player_velocity
|
||||
func _ready():
|
||||
|
||||
visible = false
|
||||
linear_velocity += transform.basis * Vector3(0, 0, -bullet_speed)
|
||||
linear_velocity += transform.basis * Vector3(0, 0, -bullet_speed) + player_velocity
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
@@ -33,10 +33,11 @@ func _physics_process(delta):
|
||||
visible = true
|
||||
|
||||
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
|
||||
if body.is_in_group("testtest"):
|
||||
|
||||
|
||||
if !body.is_in_group("player"):
|
||||
mesh.visible = false
|
||||
|
||||
#bullethole effect
|
||||
@@ -47,9 +48,9 @@ func _on_body_entered(body: Node) -> void:
|
||||
#else:
|
||||
#instance_bullethole.look_at(body.get_collision_point() + body.get_collision_normal())
|
||||
|
||||
#move rigidbodies
|
||||
if body.is_in_group("scene_rigidbody"):
|
||||
body.linear_velocity += transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
||||
##move rigidbodies
|
||||
#if body.is_in_group("scene_rigidbody"):
|
||||
#body.linear_velocity += transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
||||
|
||||
if body.is_in_group("breakable"):
|
||||
var current_velocity = transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
||||
|
||||
Reference in New Issue
Block a user