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

Any good alternatives to .Touched that don't require me to change all my code?

Asked by 2 years ago

I've been working on a fighting game for a while now, and I just now realized that using .Touched on hitboxes that I spawn in is extremely inconsistent and makes the game very unfun when only 10% of your attacks land. Is there any alternative to .Touched that doesn't require me to completely overhaul every script in the game?

1 answer

Log in to vote
0
Answered by 2 years ago

Simple Answer: There is not. You will have to use raycasting. Also, if you are having multiple scripts in the game that do the same thing.. That is breaking DRY(dont repeat yourself) coding rule. Use a modulescript to store your raycasting functions and attack and everything.

Ad

Answer this question