lxFirebal69xl Posted March 13, 2016 Share Posted March 13, 2016 I was looking into improving the already implemented flashlight, but unfortunately my limited coding knowledge made me stuck pretty quickly, so here was my idea. Have a flashlight model be a child of the fpsplayer (so it follows the mouses movement), line it up so it looks good, make a spotlight coming out of it, and then implement Hankinator's battery script to work with the new spotlight. Battery script: http://www.leadwerks.com/werkspace/topic/12783-flashlight-battery-tutorial/page__hl__flashlight Problem is, I can't really figure out how to make it so that when the player presses F, the new spotlight appears and not the current one, and also how to implement the battery part of the code to work with it. (Since the battery script interacts with the player and not a child of the player) Any guidance would be extremely helpful! Thanks! Quote Link to comment Share on other sites More sharing options...
martyj Posted March 29, 2016 Share Posted March 29, 2016 Could you post some of your code? Assuming you have an instance of a SpotLight you can hide and show it with the Hide(), Show() functions. Psudocode: function PlayerUpdate() { if window->KeyHit(Key::F) { if splotLight->Hidden() { splotLight->Show() } else { splotLight->Hide(); } } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.