- Home /
Linecast questions.
Hello everybody! I'm having trouble learning about line cast and ray cast... Right now I'm making a game where you have to aim with the mouse and when you release it the system throw an object which the speed slows down with the time. The problem is that my project is growing and I need to create more levels, but I cant do the level design properly without knowing where the object will stop...
Can anybody help me giving me the directions of the solution or some relevant info about linecast?
Thank you!
Answer by Noob_Vulcan · May 21, 2014 at 04:55 AM
Raycast can be used to get information from objects you're casting the ray at, Linecast returns true if there is a collider between the start and the endpoint of the line.
If prefer to use lineCast in case of linerender , you just say it should go from "a" to "b", whereas the raycast casts a ray from a point in a direction of your choosing.
Personally I'd use a line cast for lasers and the like in games, and a raycast for shooting at stuff.
Linecast is slower but safer way to detect intersections. Raycast is faster but not accurate.
Your answer
Follow this Question
Related Questions
Raycasting along line renderer width 1 Answer
Simple wire/cable 1 Answer
Physics.Raycast not hitting anything 1 Answer
Perspective issue with railgun/raycasting 0 Answers
Grapple Gun? 1 Answer