Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Joel_127 |
Hello,
In my game I have a bow that fires arrows. The arrows are rigidbodies with a small elongated capsule covering the arrow shaft and have a raycast node the length of the arrow to detect when it hits. The terrain is a mesh with trimesh collider.
It works very well most of the time, but sometimes the arrow goes through the terrain. The hit is always detected. Here is the code used to fire the arrow:
var bow_power = -40
arrow.apply_central_impulse (arrow.get_global_transform().basis.z.normalized() * bow_power)
How can I prevent my arrow from going through the terrain ?
Thanks in advance