This script is not working on the client…
it runs fine as a script but not as a localscript.
local p1 = script.Parent local p2 = p1
local function Raycast()
local hit
local position
local normal
local ray = Ray.new(p1.Position, Vector3.new(0,-1,0)*100)
hit,position,normal = workspace:FindPartOnRayWithIgnoreList(ray, {p2})
return({position,normal})
end
while wait() do
local info = Raycast()
p2.CFrame = CFrame.new(info[1],info[1]-info[2])*CFrame.Angles(math.rad(90),0,0)
end
edit: If you expect the stuff happening on the client to replicate to the server, it doesn’t do that. Local scripts only show up on the client, they don’t do anything anywhere else.
local p1 = script.Parent
local function Raycast()
local hit
local position
local normal
local ray = Ray.new(p1.Position, Vector3.new(0,-1,0)*100)
hit,position,normal = workspace:FindPartOnRayWithIgnoreList(ray, {p1})
return({position,normal})
end
while task.wait() do
local info = Raycast()
p1.CFrame = CFrame.new(info[1],info[1]-info[2])*CFrame.Angles(math.rad(90),0,0)
end
All of these still do not work! i have no idea why…
all that this script does is it sends a ray down till it hits a surface and then positions the part at that surface…
it works perfectly fine when its in a script but not in a localscript! i need this on the localscript because a skinned mesh is animated on client side for framerate