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

How would I make this ray script mobile-friendly?

Asked by
ACHRONlX 255 Moderation Voter
4 years ago

I have this script for wands, I'm trying to make it mobile-friendly but to no success, if anyone can help it would be greatly appreciated.

01local tool = script.Parent
02local UIS, Player, Camera = game:GetService("UserInputService"), game:GetService("Players").LocalPlayer, workspace.CurrentCamera
03local MP, MD = nil, nil
04 
05function GetMousePoint(X, Y)
06    local RayMag1 = Camera:ScreenPointToRay(X, Y) --Hence the var name, the magnitude of this is 1.
07    local NewRay = Ray.new(RayMag1.Origin, RayMag1.Direction * 2500)
08    local Target, Position = workspace:FindPartOnRayWithIgnoreList(NewRay, {Player.Character, workspace.FlyingSpells})
09    return {Target, Position}
10end
11 
12local downEvent = function()
13    if MD == true then
14 
15 
View all 46 lines...
0
Found the answer, just needed to check if they were on a TouchEnabled device and find the input position from there. ACHRONlX 255 — 4y

Answer this question