Is it possible for a character to take damage from light?
I have a character (a rolling ball character, so not a standard puppet) which I would like to take damage when it's in the light but be fine when it's in the shade.
There's obviously abilities to detect light built in because you have the toggle for shadow casting on objects. So my question is, is there a way to detect whether something is in light or not?
It's pretty much essential to my game idea and I don't want to have to map out light patches with trigger zones to deal damage if I can help it because that'll max out my thermometer in no time.
Thanks in advance!
-
Hi, sadly we don't have a light detector gadget yet. For a spotlight you can do a pretty good approximation using a cone shaped trigger zone and a laser scope to check for occlusion. Place the laser scope at the light position and set it to "Point at Tags". Then stick a tag somewhere near the centre of your character. You'll want to setup the laser pointer's labels so that it will only register a hit with the player and also turn off X-ray mode so that objects in the way will block it.
Set the trigger zone to look for the same target and apply damage when the laser scope and the trigger zone find their targets. As an optimisation you only need to power the laser scope when the trigger zone detects the player.
Hope that helps
Matt -
Hi Matt, thanks for the reply.
I'll see if I can follow this and give it a try later.
Do you think a light detector gadget will make an appearance at some point? I can see it being pretty useful in a number of situations.
Great work by the way! I'm only a week in but have already learned loads and got the basis of a game together which is way more than I expected.
Cheers,
Ben -
It would be awesome but pretty expensive. Lighting calculations are only done for the little bit of the scene you are looking at for performance reasons. A light detector would need to work wherever in the scene an object was. Potentially it could just sum the light at a particular point which would reduce the cost slightly but still involve a raycast to each light that was in range.
thanks
Matt
Please sign in to leave a comment.