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

Wierd glich? (it's wierd for me if u know how to resolve it message me)

Asked by
tomekcz 174
5 years ago
mouse = game.Players.LocalPlayer:GetMouse()
Pos = Vector3.new(mouse.Hit.p) 
clone:SetPrimaryPartCFrame(Pos)

error is

Unable to cast Vector3 to CoordinateFrame

1 answer

Log in to vote
0
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

Line 2's problem: Why are you constructing a Vector3 with a Vector3? Also, this isn't needed

Line 3's problem: SetPrimaryPartCFrame needs a CFrame, yet you passed a Vector3. However, mouse.Hit is a CFrame, mouse.Hit.p is a Vector3.

local mouse = game.Players.LocalPlayer
local pos = mouse.Hit
clone:SetPrimaryPartCFrame(CFrame.new(pos.Position))
0
but i wanted to make it un rotateable so this is why i inserted these things tomekcz 174 — 5y
0
I've edited the code for needs Rare_tendo 3000 — 5y
0
thanx tomekcz 174 — 5y
Ad

Answer this question