As my question states, whenever I’m trying to set the part to the position of the mouse, it doesn’t work. My code looks like such:
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
local MousePos = Mouse.Hit.p
local UserInputService = game:GetService("UserInputService")
local RightArm = script.Parent["Right Arm"]
local TweenService = game:GetService("TweenService")
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.E then
local Target = Instance.new("Part", game.Workspace)
Target.Position = Vector3.new(MousePos)
end
end
end)
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
local UserInputService = game:GetService("UserInputService")
local RightArm = script.Parent["Right Arm"]
local TweenService = game:GetService("TweenService")
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.E then
local Target = Instance.new("Part", game.Workspace)
Target.Position = Mouse.Hit.p
end
end
end)