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

LookVector is not a valid member of Vector3?

Asked by 1 year ago
Edited 1 year ago
local replicatedstorage = game:GetService("ReplicatedStorage")
local runservice = game:GetService("RunService")

replicatedstorage.Events.pinkPower2.OnServerEvent:Connect(function(player, mousePos)

    local character = player.Character

    local pinkpower21 = game.ReplicatedStorage.Effects.PinkPower21:Clone()
    pinkpower21.Parent = workspace.ignored

    pinkpower21.Position = character.LeftHand.position

    local connection
    connection = runservice.Heartbeat:Connect(function(dt)
        pinkpower21.CFrame = CFrame.new(pinkpower21.Position) + mousePos.LookVector <- where the error is
    end)
end)

1 answer

Log in to vote
0
Answered by
Puppynniko 1059 Moderation Voter
1 year ago
Edited 1 year ago

Lookvector is only in CFrames For your case you have to turn mousepos into a CFrame or in the remote event send mouse.Hit instead mouse.hit returns a cframe

0
how do i turn mousePos into a CFrame?? FallenAngel_ii 7 — 1y
0
As I said instead of returning Mouse.Hit.Position return the Cframe it self which is Mouse.Hit Puppynniko 1059 — 1y
Ad

Answer this question