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

Getting Mouse For Rocket Launcher (FilteringEnabled)?

Asked by 7 years ago

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

Log in to vote
0
Answered by
Tomstah 401 Moderation Voter
7 years ago
Edited 7 years ago

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.

Ad

Answer this question