I’m trying to create a flying effect on the player, and I’m using a module script to do everything. I’ve created a remotefunction to get the player’s mouse so that it would be able to fly towards the mouse’s position.
while self.flying do
rs.Heartbeat:wait()
first, second = self.mouseHit:InvokeClient(Playerr)
print(first,second)
self.bodyPosition.Position = self.humanoidCharacter.HumanoidRootPart.Position -((self.humanoidCharacter.HumanoidRootPart.Position - first).unit * self.speed)
self.bodyGyro.CFrame = CFrame.new(self.humanoidCharacter.HumanoidRootPart.Position, self.humanoidCharacter.HumanoidRootPart.Position + second)
end
^^ this is inside the module script
function MouseThing()
local mouse = Player:GetMouse()
local hitp = mouse.Hit.p
local hitl = mouse.Hit.LookVector
return hitp, hitl
end
remoteFunctions.trackMouse.OnClientInvoke = MouseThing()
^^ This is inside the local script
It errors and tells me “Attempt to call a vector3 value”.