- Edited
Trying to create a grenade, but collision is detected 50/50 only. Contibuous CD is checked for my grenage, contact monitor as well, tried setting max collisions reported to different number from 2 to 10, even adding a raycast - problem still exists.
Unable to attach the gif showing the problem. Grenade code is below.
extends RigidBody3D
@onready var collision = $CollisionShape3D
@onready var raycast = $RayCast3D
func _ready():
pass # Replace with function body.
func _process(delta):
pass
func _physics_process(delta):
if raycast.is_colliding():
destroy()
func _integrate_forces(state):
for i in state.get_contact_count():
var cpos = state.get_contact_collider_position(i)
var target = state.get_contact_collider_object(i)
print("contact: " + str(target))
destroy()
Events.explosion.emit(cpos, target)
func _on_body_entered(body):
print(body)
pass
#destroy()
#Events.explosion.emit(cpos, target)
func destroy():
queue_free()