Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why use Raycasting?

Asked by 8 years ago

Hey, there so I wanted to know as to why I should use Ray Casting like lets say that I have a gun alright. I have a Gun Script inside of it and the Gun by the way is a tool. So I have the script that makes the firing and all happen when you left click. Then why do people use Ray Casting for this? Why not use projectiles that are fired from the gun(aka bullets)? And then add a touched event to the projectile that is fired from the gun. However, people use Ray Casting instead of making a projectile firing from the Gun. Because if u do make it to Ray Casting then wouldn't it make the bullet impossible to dodge? Which is not my idea of a 'fun game'. I know that you can dodge it with ray casting as long as u don't let him point his mouse towards you but, I want it to where you can dodge the bullet as it's coming towards you rather then just automatically doing damage after the person clicks on your character. That's too boring.

Thank you for reading my answer and any information helps.

~~ KingLoneCat

0
Some people like lasers, some people can't make projectiles. I use raycasting in guns because it's easier. Projectiles for me are über hard. theCJarmy7 1293 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

The problem with the bullets you described is, that the Collision detection sometimes fails or delays, which can't happen while RayCasting. Also it can cause lags, since you are creating many moving parts. (Please Upvote, so I can Upvote others)

1
Please, do not ask for upvotes. You will earn them if you elaborate complete answers and help other people with them. I think this is a good answer, and thus will upvote it, but not everyone thinks the same as me. TheArmoredReaper 173 — 8y
0
Alright, thanks! Dolphinous 36 — 8y
Ad

Answer this question