I can't find a tutorial or way to make a keybinded attack for a laser on where a mouse is. Does anyone know where I can find this? I want the arm to point towards the direction of the mouse with an object in my character's hand and then once I click it shoots. Then once I press the keybind the object disappears. But this only works for my custom character. Does anyone know where I can learn how to do this?
COMMUNITY QUESTION
How do you make a keybind laser attack?
1 answer
My best guess: I recommend using the Mouse API to get mouse hit positions: https://developer.roblox.com/en-us/api-reference/class/Mouse
I also recommend raycasting to check if it hit anything: https://developer.roblox.com/en-us/api-reference/datatype/Ray https://developer.roblox.com/en-us/articles/Making-a-ray-casting-laser-gun-in-Roblox
If you have any questions or issues contact me. :)
This discussion is preserved as it was. New answers, comments, and votes are closed.
