(Repost because… last topic didn’t quite work out nor was there any further answers given)
I have no idea about how that would work but
Is there a way where I can make the beam’s second attachment detect if something is in the way, for example a player, or a part?
So… Is it possible to make an attachment auto-adjust itself down to where a part is, if so, how would i achieve something like that?
I want to have my Beam System be as realistic as possible, I don’t like beams colliding through* blocks or parts, or everything.
Script demonstration would be appreciated.
Location of the beam:
I would suggest using
for i,v in pairs (game.Workspace.TaLights:GetChildren()) do
in the script, because I have multiple instances of these inside of the Folder.
The following Attachment will be used in the script: AttSky
They have a nice tutorial on it. Get familiar, try something out, and we can help from there. You know the 2 ends of the beam, that should be a good place to start.
(Raycasting is probably the single most useful thing I’ve learned on Roblox so far)
hey man, I just made a light thing that you wanted to. Heres the file to it. . If it works then feel free to use it in your game. And make this the solution(If this works of course!) Light test for rando.rbxl (34.0 KB)
XDDDDD. I’ll try to fix that but i think it’s because the part is unanchored. Btw this is my first time working with beams so I dont know much about them.
you need to set your raycast to whitelist, and have it only go over a map folder.
inside of that map folder is where you will put your map (basically anything you want to block the light beams your making)
then you (on the client) perform the raycasts for all of your beams, I’d say every other frame.
if you don’t know how to do stuff frame by frame, look into RunService.RenderStepped on the devhub.
if the raycast doesn’t hit, you set the attachment to it’s farthest possible position (the one shown in your original video) if the raycast does hit however, you put the attachments position to the hit position.
Again I’d reccomend checking the devhub for how raycasts work.
So, I kinda fixed it except im not sure if it’s how u want it to be but I’ll still give u the place file here. oops wrong file… Light test for rando.rbxl (34.3 KB)