Facepunch / garrysmod-requests

Feature requests for Garry's Mod
86 stars 24 forks source link

Bind "SetGravity" for all entities #2422

Closed DrVrej closed 4 months ago

DrVrej commented 5 months ago

Details

Currently "SetGravity" only works for players, but in the engine, it used in many other places and works for all entities. It's very useful for projectiles as it makes the trajectory code much simpler to calculate by using a consistent gravity. An example can be found in grenade_spit where it sets the gravity to 600 -> Link. Aside from projectiles, it's also used for couple of NPCs, which would also be useful to have access to in Lua.

robotboy655 commented 4 months ago

But it is bound for all entities.

https://wiki.facepunch.com/gmod/Entity:SetGravity

DrVrej commented 4 months ago

Thank you for the reply, I didn't test it personally as the wiki had a red bold warning stating it's for players only. I see that you just removed the false note which is good as it must have confused many others too. 👍