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)
|
||||
|
||||
@@ -200,14 +200,14 @@ func _physics_process(delta):
|
||||
#initiate fast movement -- may be done with this block
|
||||
#change sounds with speed
|
||||
if moving_fast:
|
||||
var wind_volume = clamp( velocity.length() - 20 ,-20,10)
|
||||
var wind_volume = clamp( velocity.length() - 20 ,-80,10)
|
||||
ear_wind.volume_db = wind_volume
|
||||
#reset at apex
|
||||
|
||||
#cache fastest speed
|
||||
if abs(velocity.y) > moving_fast_top_speed:
|
||||
moving_fast_top_speed = abs(velocity.y)
|
||||
#print("TOP SPEED = " + str(moving_fast_top_speed))
|
||||
|
||||
#Land Sound
|
||||
if velocity.y < .1 and self.is_on_floor() and moving_fast == true:
|
||||
print("LAND SOUND")
|
||||
|
||||
Reference in New Issue
Block a user