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 2 years ago
Edited 2 years 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
2 years ago
Edited 2 years 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 — 2y
0
As I said instead of returning Mouse.Hit.Position return the Cframe it self which is Mouse.Hit Puppynniko 1059 — 2y
Ad

Answer this question