Skip to main content

Posts

Showing posts with the label collider

Prevent colliders from passing through each other.

Avoiding your objects from passing with each other is really tricky especially for fast moving objects like bullets and Prevent colliders. Today we made tutorial and script for you to show how to prevent colliders  from passing through each other. The best way to make sure that you detect all collision is to use Raycasting instead of depending on the physics simulation. This is helpful for bullets or small objects, but will likely not provide great results for large objects.  Below answer is from stackoverflow Collision with fast-moving objects is always a problem. A good way to ensure that you detect all collision is to use Raycasting instead of relying on the physics simulation. This works well for bullets or small objects, but will not produce good results for large objects. http://unity3d.com/support/documentation/ScriptReference/Physics.Raycast.html Pseudo-codeish (I don't have code-completion here and a poor memory): void FixedUpdate() { Vector3