Next Update v4 - March 2016 Update is out!

Try on the dev branch

People complain about EVERY change, dammit. That’s just a fact of life.

Well they also caused a lot of crashes at first too so there’s that.

So when is vehicle crazy physics getting fixed. I can’t drive a car without someone punting it and it disappearing

What’s output in to the server’s console when that happens?

Could someone fix EntityFireBullets?

It seems to be only returning the right damage if a SWEP dealt the damage

I have already reported this times ago, it may also happen with playermodels sometimes.

Err, is Global.EyePos broken?

] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235

Each one was run after I moved. This was on gm_black_v2, so I ran “map gm_construct” and proceeded to run the same command… and it gave me the same result. the same vector as before, even though an entirely different map has been loaded and everything should have been reset.

Quit, switch back to live (I was on dev before), open sandbox on gm_construct and:

] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000
] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000
] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000

(again all run when I was somewhere else physically)
Errr I’m not sure why I’m even posting this here. I should go to garrysmod-issues.

Works here, vanilla Dev branch.

] lua_run_cl print(EyePos())
845.221313 551.926086 -79.968750
] lua_run_cl print(EyePos())
511.613342 92.342567 -85.184128
] lua_run_cl print(EyePos())
258.032898 49.622017 -52.993706

Keep in mind the function returns the camera position of the local player, i.e. where the view is, not like eye position on the player model or something, that’s what Player.GetShootPos() is for.

It seems to be random whether this works or not.

Noclip seems to affect it, but not deterministically.

Edit: and yes, I would have mentioned if I was viewing it in anything other than regular normal first-person

Edit: I’m still looking for a reliable way to reproduce it before putting it on garrysmod-issues, if anyone can at least confirm that it’s not just me, that would be great…

I had some funny stuff going on the other day. Spawn a prop and run it again.

It’s better to hook into CalcView and just save eyepos from here.

Spawning a prop does cause EyePos to update ONCE, but it gets stuck immediately after.

My current method of printing it is:

bind - "lua_run_cl chat.AddText('Global: ', tostring(EyePos()), '
Player: ', tostring(LocalPlayer():EyePos()),'

Actually, I’m going to record a video of it… brb.

Note, that I’ve only tested this in Singleplayer, so it may be singleplayer-only. The function seems to be sparsely used in vanilla gmod, but is a factor in determining whether to draw tooltips on sandbox entities. Really annoying when it doesn’t get drawn.

Edit: [video][/video]

I’m not trying to use it myself, it breaks vanilla gmod code.

hmm, that’s why you sometimes cant see it

Exactly. Looking for the source of that issue is what caused me to discover it.

Start with disabling all addons. ALL of them. Then start adding 1 by 1 until the issue happens.

I am pretty sure something that fucks with rendering of the view is causing it for you ( Like rendering additional views? Rendertargets? )

I’m still getting it with a fully vanilla gmod:
[lua]lua_run_cl print(EyePos())
0.000000 0.000000 0.000000[/lua]

Spawning something then fixes it:
[lua]lua_run_cl print(EyePos())
13399.613281 1062.790405 2367.308105[/lua]

I disabled all my workshop addons, and as far as I know, I don’t have any plaintext addons/edits that do anything of the sort. However, I will still do a clean install and see what happens. (Edit: seems I won’t need to do that since it was confirmed in the above post)

In the mean time, I just recorded a more thorough video. I recommend you watch it at 2x speed if youtube gives you the option, it’ll save time and will get the point across:


I don’t think EyePos is going to ever work unless you’ve got it being called constantly in the correct render hook and not in any other render hooks. Maybe some code that was calling it was taken out in a recent update.

The way I see it there are 2 options:

  1. Fix it.
  2. Deprecate it and replace all vanilla code that uses it with something else that actually works.

If 1 is impossible (or not worth the trouble, your call), then 2 is the only other option.