WeldTree.rbxl (60.4 KB)
I restarted roblox and it’s fine. Then I pressed play again and it broke…
okay I swear I didn’t touch anything :0
if I change something, it works, but if I don’t it, doesn’t?
ok it took me a while but i think i finally understand what’s going on. so in your freecam script on line 393 you have this line.
RunService:BindToRenderStep("Freecam", Enum.RenderPriority.Camera.Value, StepFreecam)
which from what i gather basically is updating the position of the players actual camera every frame to match what it should be according to the free cams position i guess. anyways in your local script you have this line,
RunService:BindToRenderStep("Selection", Enum.RenderPriority.Camera.Value, selection)
which makes it so every frame you are casting a ray from the camera’s position.
so every frame the camera position is updated then after that you cast your ray from the camera. thats whats supposed to happen but because you have both of these binds set to the same priority roblox doesnt know which one to do first every frame so it kind of just goes off of which script binded this first (which would explain the randomness of this glitch).
if they don’t fire in the correct order you will end up with a situation where every frame you first fire the ray then set the camera’s position (the ray will go based off the old position instead of the new one).
anyways TL;DR: change the priorities of these two binds so that the free cam priority is higher
that should fix the problem hopefully
This is an interesting theory, but at 0:27 the camera isn’t moving, yet the position is way off. Can you explain this? Thanks!
well im not exactly sure how your free cam works excactly but if i had to guess it seems like it moves the camera from its original position every frame to a new one. then some how the camera is positioned back at its old position next frame. again i dont know how this happens because i dont really want to look through all the code in that free cam script but i did do a test where i had the function that moves the camera each frame print the camera before the move and then after the move.
as you can see from the second image the position of the camera is in fact changing every single frame and this function moves it back into place where its supposed to be. this happens regardless of whether or not im actually manually moving the camera around or just sitting still.
I can’t get it do the bug if
RunService:BindToRenderStep("Selection", Enum.RenderPriority.Camera.Value + 1, selection)
or
RunService:BindToRenderStep("Selection", Enum.RenderPriority.Camera.Value - 1, selection)
but it pretty consistently does if I don’t add or subtract anything. So maybe you’re right :0
Are you also getting the bug? Thanks!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.