#Ray tracing camera local script problem
1 messages · Page 1 of 1 (latest)
Here is the script:
I want whwn the ui is on to work this only
the local script is located here:
Use the mouse.Hit approach instead, since you already have access to localPlayer:GetMouse().
Replace your mouseClickConnection block with:
mouseClickConnection = UIS.InputBegan:Connect(function(inp, proc)
if proc then return end
if inp.UserInputType == Enum.UserInputType.MouseButton1 then
if uiElement.Enabled then
local targetCFrame = mouse.Hit
if targetCFrame then
local explosion = Instance.new("Explosion")
explosion.Position = targetCFrame.Position
explosion.Parent = workspace
end
end
end
end)
what's going wrong with your script? The mouse logic looks fine to me at least
bro im not a black market chill out was trying to help lil dude
so, what i am gonna do?
u gotta tell me what the issue is
ok
take a look:
when i press x to open the camera and enable the ui and then i click in different places it doesnt make an explotion.
@slim robin
can u put a few prints in there
ok let me fix it a bit
I put some prints here but they dont work any idea?
-- Mouse click to create explosion
mouseClickConnection = UIS.InputBegan:Connect(function(inp, proc)
print('0')
if proc then return end
if inp.UserInputType == Enum.UserInputType.MouseButton1 then
print('1')
if uiElement.Enabled then
print('2')
local targetCFrame = mouse.Hit
if targetCFrame then
local explosion = Instance.new("Explosion")
explosion.Position = targetCFrame.Position
explosion.Parent = workspace
print('3')
end
end
end
end)
none of them work?
yep
hm its weird that none of them are showing up at all can u send the whole script again
also this says mousebutton1 not X
** You are now Level 5! **