Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

making an autoturret?

okay, so i know how to make everything else in an autoturret, except this:

rotating every part in the autoturret, and depending on where it looks, it would scan through every model until it sees a a player model, then it can execute more functions, etc. sort of like the tf2 turret the engineer has

example pic: https://gyazo.com/153e79dde146f02d87f3669679498c0c

help on this would be appreciated

1 comment

0

please provide your current script or it makes this seem like a request

1 answer

✓ Accepted answer

So from what im understanding, you want a turret that turns and find a target. To do this i would recommend raycasting. Ray Casting allows you to create an invisible, sort of "non-existing", line with set dimensions into 1 direction. You could use this on the front of the turret.

Now for rotating part on the turret, use welds. Use you should use this in order to connect all the parts to one part, The center part preferably. This will allow you to rotate the base part along with all the parts welded to it.

So all in all those are the things you would need to do what your trying to do. This would require many loops and conditions, but i think you can do it

~~Hope i Helped :D

3 comments

0

Or you can set a primary part and make the rotatable part in a model and rotate it using :SetPrimaryPartCFrame() and face towards whomever is close

1

thanks koolkid, you helped a lot! :D i never used raycasting before, but it looks really useful. thanks!

0

anytime

This discussion is preserved as it was. New answers, comments, and votes are closed.