Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | PurpleLeprecaun |
I have a projectile that consists of:
RigidBody
|-CollisionShape
|-MeshInstance
|-Area
—|-CollisionShape
The Area’s collisionshape is slightly larger than the rigidbody’s collisionshape, when hitting another rigid body the projectile will sometimes BUT NOT ALWAYS push the other rigid body without triggering the _on_Area_body_entered function. The script is attached to the rigid body. The projectile will interact flawlessly with the static body I’m using for a floor and will sometimes interact correctly with the rigid body targets but more often than not it will just push the rigid body without ever triggering the _on_Area_body_entered function.
func _ready():
connect("body_entered", $Area, "_on_Area_body_entered")
func _on_Area_body_entered(body):
print_debug("Hit")
I originally connected the signal through the editor but connecting it through code had no effect. Continous Cd has no effect as well. My only thought is that sometimes the area enters the target body faster than it can detect it and I’m only checking for hit on enter. I’m losing my mind trying to find a solution so any help is appreciated.
use Raycast if the bullet is too fast
ramazan | 2022-07-18 16:43
I should have specified, that’s on me, that the projectile is a rocket, i want it to have travel time
PurpleLeprecaun | 2022-07-18 17:23
I made the area larger and it fixed the issues
PurpleLeprecaun | 2022-07-19 23:09