Hi everyone, this is my first post so I apologize if it isn’t concise. I’m trying to replicated an object into workspace from “ReplicatedStorage” with a script attached to it that’s simply supposed to print “Loaded” but for some reason it doesn’t run.
I’ve worked on a different game where I have achieved this with no issues. I am confused as to why this time, it’s not working.
Local Script:
local mouse = game.Players.LocalPlayer:GetMouse()
local ScreenSize = camera.ViewportSize
local MissilePrefab = game.ReplicatedStorage.Prefabs.Missile
mouse.Button1Down:Connect(function()
local UnitRay = camera:ScreenPointToRay(ScreenSize.X / 2, ScreenSize.Y / 2)
local ray = workspace:Raycast(UnitRay.Origin, UnitRay.Direction * 1000)
if ray then
local missile = MissilePrefab:Clone()
missile.Position = UnitRay.Origin
missile.Parent = workspace
missile:WaitForChild("RemoteEvent"):FireServer(ray.Position)
end
end)
the script:
print("Loaded")
I’m really not sure what to try to fix this, any and all pointers would be very helpful! Thank you!