-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Flashlight / Third Person Flashlight #1486
Comments
I wonder how this interacts with GMod Legs |
Maybe it is also possible to add a player model for the local player, that only interacts with the light, but is not rendered |
Also I'm wondering if we could create a basic custom animation library that is integrated into TTT2. Similar how we did with it with the view and world models. Adding more animations and sounds is something I really want to focus on to give the game a more polished feel. Our version of that library should support world model animations though, as it would be nice to see these animations on any player. We'd probably also need a flashlight model that is attached to the shoulder or so |
I have the feeling that you will just have a shadow from your lower body
Would be nice. VManip already shows us what animation you guys could add. I like that shoulder tap to turn on the flashlight, the "grab to pick up" and "stretch hand out to interact" is also very nice and immersive. That one addon also adds things like "putting hand infront of the face" when the player did get explosion damage.
Isn't that pretty hard since there are any servers that are using custom models? I don't mind seeing no flashlight on the model and if it's turned on you can't see it anyways because of the light. |
There are attachment points on models, like the hands where the weapons are rendered. It is basically an extension of the custom world model stuff I already did |
Is your feature request related to a problem? Please describe.
Adding a third person flashlight would be greate because I have seen it so many times that someone tryes to hide in the dark and thinks that they are pretty hidden but for another person who has the flashlight on the whole room might be lit up but the person hiding doesn't see this at all. If the flashlight would also light up the room for everyone like the person with the flashlight sees it, the person hiding will see that he isn't in the dark anymore. (And shadows casted from a flashlight do also look pretty cool)
Describe the solution you'd like
A flashlight that lights up the world not only client side
Describe alternatives you've considered
Looking at videos and the workshop I found the Dynamic Flashlight mod that pretty much does all that. The problem is that this mod had a bug with turning off the flashlight but a user in the comments did fix this but there where still other bugs around like:
Additional context
I tryed to fix most of the bugs this mod has.
:EyePos()
to get the right hight for the light so the light always starts from the players eyes to light everything up form his perspective. This also fixes the problem that the light stays at the same hight when crouching.:SetNearZ()
value to let the light ignore everything to close to the light so it can shine through his head.So overall, the flashlight works flawless in first person but the third person view still has some problems
Open problems
NearZ
value. When running, the playermodel seems to be a bit faster than the light source so if the player runns at high speed, his head can still poke into the range where shadows are casted. You can prevent this with an differentNearZ
value but there is another problem. When the player with the flashlight has a weapon that is infront of his view, it will cast a shadow. Other players see for example a big magneto stick shadow. In first person this is invisible for you since the stick perfectly blocks the light but I don't know how this behaves with other weapons that could be in the sight like for example a rocket launcher model. Changing theNearZ
value can prevent this but this needs to be tuned.Other possible upgrades
Code
It's very much the same original code, just with my fixes.
The text was updated successfully, but these errors were encountered: