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

Getting Mouse For Rocket Launcher (FilteringEnabled)?

How do I get the mouse for a ServerScript in a way the rocket will follow the direction the mouse is pointed? (Or how do I make the rocket follow the mouse in general?)

1 answer

In a local script you can run the code:

local HitVector = game:GetService("Players").LocalPlayer:GetMouse().Hit.P

This will return where the mouse is "aiming" as a Vector3! If you need it in a server script, you'll have to pass it through either Remote Events or Remote Functions. If you need the local script to get some new information than you'll need to use a remote function. If you only want to pass some information or trigger an event you'll want to use a simple Remote Event.

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