• EyeAngles not working
    8 replies, posted
For some reason EyeAngles is massively broken on my server, an example of which can be seen in [URL="https://fat.gfycat.com/SpitefulEnlightenedCrownofthornsstarfish.webm"]this video[/URL]. EyeAngles() always returns the same value, unless I am looking in this very specific place in the map (it is literally broken anywhere else). The same is also true for EyePos() and EyeVector() apparently. On the other hand, calling LocalPlayer():EyeAngles() always returns the correct results (presumably because the server controls those values?). Things I have tried so far: Using sandbox's CalcView hook Removing literally all hooks Not running [I]any[/I] of the gamemode code on my client On the same map in singleplayer I do not experience this issue, so I'd assume it has to be caused by something the server does, but what could possibly cause this?
This may be a bit redundant, but have you tried a different map on the gamemode + server? You can always double check: [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/debug/getinfo]debug.getinfo[/url] with that function just to make sure it's not being overwritten.
Since it does not happen on the same map in singleplayer, I doubt it's the map's fault. There must be something the server is doing that is breaking stuff. I am bone merging many things, maybe that could be a cause? Also,EyeAngles() is not overridden anywhere in the gamemode. Even when I didn't run any of the gamemode's code (clientside) it was still broken,
[QUOTE=syl0r;52604073]Since it does not happen on the same map in singleplayer[/QUOTE] Maybe the problem is somewhat related to prediction? Prediction is turned off in singleplayer
It's not really an issue on any other server with the same map either, so I don't see how it could be prediction?
Yeah you're right. I assumed the prediction code could override the viewangles before they are sent to the server, but since you already tried running the gamemode without any clientside code this cant be the case. (Also, the prediction hooks don't seem to have access to CUserCmds. Oops)
It is possible that this is not an error with EyeAngles, but an error with whatever is rendering the scope. Can you produce the code responsible for this?
This might be related: [url]https://github.com/Facepunch/garrysmod-issues/issues/2516[/url]
[QUOTE=James xX;52604519]It is possible that this is not an error with EyeAngles, but an error with whatever is rendering the scope. Can you produce the code responsible for this?[/QUOTE] The problem is not related to the scope, I just used it as an example for the video. Any call to EyeAngles() has this problem. [QUOTE=zoox;52604973]This might be related: [url]https://github.com/Facepunch/garrysmod-issues/issues/2516[/url][/QUOTE] You seem to be correct, during my testing I also found that when I printed EyeAngles in a specific hook it would always work. And indeed, running [LUA] hook.Add("PreDrawTranslucentRenderables", "FixEyePos", function() EyePos() EyeAngles() end) [/LUA] fixes the issue. Still weird that (almost) no one else seems to be experiencing this. Thanks for the help.
Sorry, you need to Log In to post a reply to this thread.