#bug?
1 messages · Page 1 of 1 (latest)
how are you certain the collision is actually disabled? what did you do to check?
i watched it inside the models
during runtime? sure you checked the right one? i'm guessing it's a tool parented to your character
atleast the models, they r collide false
some guy helped me doing this so, the scripts idk
that looks like normal character collision except your camera is messed up a bit
it looks like you have a custom camera
unequip the torch and see if it still happens, please do show recording of this
under exact same circumstances
idk how to, this is the entire flashlight, is not a tool in starterpack
er, except maybe adding a pointlight nearby to see whats going on
i'm saying it may not be the flashlight
also that is in replicatedstorage. that is not the flashlight in your character's hands.
lighting is the model for the flashlight, he made a script to tp it to the hands i think, for the animation, the handle i think is decorative
lightbone is the ring i supose
you may be guessing, i am not. if it is not in workspace, then you are checking the wrong one. no lighting appears unless it is in workspace.
check it while the game is running.
and i checked all inside that, collide is false
so then it is probably something in your camera code.
i'd suggest try this
.
they are not the same, anything could happen during cloning or maybe you have a script that messes with collisions. it's not worth making any assumptions and just check it directly
k
yeah looks good so that doesnt look like its colliding
tho i'm guessing you took this from the server view? it needs to be checked on the client coz if any collisions happening there, that's what is going to mess with your camera, if anything.
also should ask, does this happen with any other tools or ONLY the flashlight?
thats server side, yes. to see how the flashlight collides with the wall. but in client its the same
nothing more, this is the flashlight for a terrro game
so is only the flashlight there
if u want i can send u the scripts
oh so you don't actually have any other tools to check it against?
in the first pic looks like it collides, cuz the invisible flashlight is watching the left
no
i can look for a model in models, and put the tool in the starterpack
yes that does look unusual
when i run the game, the invisible flashlight goes to my camera like in that image, and as u can see, is like it collides, so the problem is this model, only this
want to see the scripts?
Thinking deeper, i gonna see if this is anchored, if it is, so maybe is there any form to make it always be like the second image, right?
i'd suggest asking the person who gave you scripts to do this
Alr but is not answering

local User_Input_Service = game:GetService("UserInputService")
local Run_Service = game:GetService("RunService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character
local Player_GUI = player.PlayerGui
local Mobile_Button = Player_GUI:WaitForChild("MobileButton").Frame.Flashlight
local Mobile = User_Input_Service.TouchEnabled
local Camera = workspace.CurrentCamera
local Mouse = player:GetMouse()
local Events = Replicated_Storage.Remotes.Events
local Flashlight_Event = Events.Flashlight_Toggle
local Replicate_Event = Events.Flashlight_Replicate
local Flashlight_Activated = false
local playing = false
local animation = script:WaitForChild("Animation")
local animTrack : AnimationTrack = character.Humanoid:LoadAnimation(animation)
animTrack:GetMarkerReachedSignal("Activate"):Connect(function()
animTrack:AdjustSpeed(0)
end)
local Flashlight_Debounce = false
local function Toggle_Flashlight()
if Flashlight_Debounce then return end
Flashlight_Debounce = true
Flashlight_Activated = not Flashlight_Activated
if playing then
animTrack:AdjustSpeed(1)
animTrack:Stop()
else
animTrack:Play()
end
playing = Flashlight_Activated
Flashlight_Event:FireServer(Flashlight_Activated)
task.delay(0.6,function()
Flashlight_Debounce = false
end)
end
User_Input_Service.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.F or input.KeyCode == Enum.KeyCode.ButtonR3 then
Toggle_Flashlight()
end
end)
Mobile_Button.Activated:Connect(Toggle_Flashlight)
local Frame = 0
Run_Service.RenderStepped:Connect(function()
local Target_Position = Mouse.Hit.Position
local Right_CFrame : CFrame = character.Head.CFrame * CFrame.new(1.5,0,-1.5)
if Mobile then
local Params = RaycastParams.new()
Params.FilterDescendantsInstances = {character}
Params.FilterType = Enum.RaycastFilterType.Exclude
local Ray_Results = workspace:Raycast(character.Head.Position,Camera.CFrame.LookVector*100,Params)
if not Ray_Results then
Target_Position = Right_CFrame.Position + Camera.CFrame.LookVector*2
else
Target_Position = Ray_Results.Position
end
end
Light_Bone.PrimaryPart.CFrame = CFrame.lookAt(Right_CFrame.Position, Target_Position)
Frame += 1
if Frame >= 5 then
Replicate_Event:FireServer(Light_Bone.PrimaryPart.CFrame)
Frame = 0
end
end)```
if u want to see it this is the entire code
If not I will have to do that I do later
Anyway thanks
Run_Service.RenderStepped:Connect(function()
local Target_Position = Mouse.Hit.Position```
the fact that there's a raycast being used in this code suggests it is your code that is 'colliding', not the flashlight.
How can i solve it
Light_Bone.PrimaryPart.CFrame = CFrame.lookAt(Right_CFrame.Position, Target_Position) shows usage of the raycast
so i'm not surprised the light is being deflected like this
the hit position is behind where the light parts are in this collision situation where the light parts are through a wall but your mouse ray is hitting the wall, so it is facing backwards because of the cframe.lookat
The flashlight tool wasnt doing this cuz is a part with spotlight, not a raycast or smt like this, right?
👍 close enough. flashlight code not camera. i thought you meant the camera shaking at first ;p
why does the flashlight need to reposition the light every frame? that's dum
Oh cuz i have a script for first person, so o missunderstanded
whoever helped you make it this way is bad and should feel bad
Well i didnt created it, but im happy cuz he can solve many problems in my flashlight, but always there is an error
they're probably using chatgpt coz that is a really stupid way to do it. just weld a spotlight to the lens, you don't need any code at all
or all this lightbone and lightpart shenanigans
just weld the darn thing
though i guess, you do wanted pointed in your camera's direction 
...so then weld it to the camera lol duh
Is the same that he said about the flashlight model i had "the dude that did this is dumb"
This flashlight is a bucle of errors and fixes
well thats what u end up with when you take the lazy solution
and just beg people for help over and over and you end up with worse than a copy of a copy of a copy.
some people develop that way, please don't be one of them
chatgpt goes the same way
No no like i did it by myself, i tried for hours
But as a non scripter is crazy to do it
in short, weld the light to the head like a headlamp
or you can weld it to the flashlight
they have slightly different results but both will stop it deflecting and pointing behind you in collision situation
Nah i want to study code, i was watching videos, cuz scripting is the hearth of the games and im soloing a horror game as a newbie builder
** You are now Level 8! **
K
or change the lookat to instead point in the camera's direction instead of towards the mouse hit position
3 different solutions, each have their niche pros and cons ;p
For doing this i need to change the script then?
this would require the least amount of change to the code
using cframe.lookalong + mouse direction vector like currentcamera.lookvector instead of cframe.lookat + mouse hit position
Ngl i ever cant make a part anchor with code, but i understand a little little bit, im cooked
THANK YOU
I CHANGED IT
war is fking over
nah its still a fair bit of a bandaid on top of what is probably already another bandaid because you have an entirely different raycast in there for mobile so it will probably look different. battle is over, but not the war.
in mobile is the same, It is supposed, but not for the ring
mobile was working well but withouth ring and they cant see their own body
still, i'm glad you know enough to take that basic direction and apply it. pretty simple change, but many beginners wouldn't understand how to do that ;p
erm

when im mean im new, is for real
but i can understand a little bit codes for watching them
this week i learnt a lot
then your war is far, far from over.
yep, but not with the flashlight
i need to learn a lot a lot a lot
for this game
a small battle among many more to come.
exactly
specially if you keep this up
triggers, events, for the game, and more
learn to code properly imo but 🤷 you do you http://wiki.roblox.com
ye, i watched begginers tutorials
gonna take months to learn properly
so, lets work