Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

RPG in a Box

Bring your stories and ideas to life! · By Justin Arnold

Is it possible to create a flashlight torch?

A topic by Daza created May 06, 2017 Views: 198 Replies: 5
Viewing posts 1 to 6

A flashlight torch that projects/beams the light straight a head of it (when on) and have everything else dark?

Currently I don't think there's a way to set up a light as a torchlight like you describe, but you can create an empty model which emits light and use it as a tile, an object or even a character, and script it to move or appear/disappear when needed. There's no function to globally control the lighting of a map yet, so you'll have to set up a level with dark lighting and colors and use local light sources for now, but I believe Justin has planned more lighting-related features for the future. The new Godot version will probably offer a lot of new lighting & shaders possibilities as well.

Okay thanks lectronice. What about holding an object? such as a burning torch? or the PC cannot pick up/hold objects that can be held yet? I wanted to do a battery operated torch that the batteries slowly drain, so the player might have to turn it off to save power and use their memory of what they last saw as they navigate tunnels/cave.

I was going to ask about being able to have some global control of lighting of a map too. Lighting plays a big part in games and films to set tone and mood or even as example like Minecraft how you have varying degrees of light, very dark areas and some poor lit areas to very bright areas. I wonder if we will be able to set up lights like some 3d programs like Poser, choosing direction, radius and intensity. I suppose this will come when the new features that is coming to the Godot engine is updated? or some point after.

(1 edit)

Hi Daza - there currently isn't any concept of holding objects (besides items in your inventory), but it is something I may explore down the road.

In regards to lighting, there are a few different types of lighting you can currently adjust in your map. Under the map properties on the left, there is an ambient light, which is basically the overall global lighting for the entire map, and a directional light, which simulates the sun. With the directional light you can adjust the angle, color, brightness, etc from the properties panel.

Also, besides setting objects as "light sources" from the Voxel Editor, you can also add extra positional lights to the scene in the Map Editor's Edit Mode by right clicking an object or tile then selecting "Add Light". This adds a light at the location of the selected object. The light will show up in the properties panel, and from there you can tweak settings like position, color, etc. Hopefully that is helpful!

Godot also supports spotlights which can be used for things like flashlights, but I just haven't gotten around to implementing those quite yet. I also plan to add some scripting functions later on to let you dynamically adjust lighting.

Thanks Justin for your reply. I didn't catch it until now. That sounds good. I suppose when a spotlight is added, we could switch to the PC model that has a torch in their hands (not as a separate object) but part of the character model as a work around.

Having a flashlight would be great for exploration type games, like in Minecraft exploring in the dark with just a torch could get quite tense knowing there are mobs luring around in the dark or you might fall down a hole.

Yeah, that could definitely be cool! At some point I'd like to look into some way of attaching weapons, items, etc. onto a player for them to hold, but I'll have to work out the best way to handle that. As you suggested, for the time being you could have a separate set of frames with the flashlight in the player's hand.