Skip to content

lexonegit/Unity-2D-Raycast-Hit-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2D Raycast Hit Detection

2D Raycast Hit Detection is a tool for detecting if a moving object hit something using raycasting. It is useful for when you need more precise detection quality or the object is moving very fast (a bullet for example)

Note that this is not a 100% user friendly script. You most likely need to modify the script to suit your needs. Also with a bit of tinkering this should be easy to convert for 3D games as well

Usage

  1. Add Sensors.cs to a gameObject
  2. Assign the 3 transforms in the inspector
  3. Tweak the options to see what works the best

I recommend looking at the included ExampleProject for a better understanding

  • This gif shows the 4 levels of detection complexity

Releases

No releases published

Packages

No packages published

Languages