In a object where to use raycasting?
Particularly where raycasting in a game is used? How it is used? What are the characteristics of raycasting?
Answer by DanSparrow · Feb 08, 2017 at 03:26 AM
It kinda depends on the game genre. For example, if you were creating a shooter or an FPS, you'd use Raycast to determine where the player is pointing, and use that contact point to instantiate bullet holes, particles, etc. Raycasting basically lets you cast an imaginare (though you can make it visible) line in a certain direction that will collide with any object holding a collider, and will help you store where that object is, and the exact point of contact.
About how it is used, you have quite a few examples in the Unity Documentation: https://docs.unity3d.com/ScriptReference/Physics.Raycast.html
Also there are plenty of video tutorials in youtube about this specific and very useful feature.
Your answer
Follow this Question
Related Questions
RayCastHit 2d with layerMask not workin 0 Answers
Help with Raycast Script 0 Answers
A cube, raycasthit and rotation 0 Answers
Raycast Going Though walls 0 Answers
MoveToInteraction takes 1 argument 1 Answer