@Silver-Streak I like you idea even if it’s not going to be accurate but I want to test this so bad and see if it works, thing is I’m trying at the moment but I just don’t get it that well as It’s almost my first time using raycasting, I know how raycasting works and the idea behind it … but I never used it before so I’m a bit confused:
First of all because I’m so confused let’s work with only 1 light source, 1 obstacle and the player
so let’s edit your idea around only these 3 objects as follows:
-
Pick the nearest light source object to the player. Add the light source AND obstacle to a separate object group.
-
Raycast from the player to the nearest member of the “group mentioned above”. Set up a condition that ensures the object hit IS NOT an obsticle.
-
Ensure the raycast’s maximum distance is the light radius.
.
.
Now let’s dissect what I did and take it one step at a time:
- Pick the nearest light source object to the player. Add the light source AND obstacle to a separate object group.
Here what I did:
So like I mentioned above I have 1 light source, 1 light obstacle and the player, here is the whole scene running in preview:
Then I have the group which have both the light source and the light obstacle here:
I added the event you mentioned here but I don’t think it’s not needed if we’re working with just 1 light source for now:
.
.
- Raycast from the player to the nearest member of the “group mentioned above”. Set up a condition that ensures the object hit IS NOT an obsticle.
Now let’s slow things down here and take it step by step because I have questions here…
“Raycast from the player to the nearest member of the “group mentioned above””
How to say that in events?
I have 2 raycast events, one with an angle and one with a position, which one to use? and in both cases what is the angle? and what is the position?
Here is what I did but I have no idea if it’s correct:
“Set up a condition that ensures the object hit IS NOT an obsticle.”
I have no idea how to check if a ray hit an object or not using events?
.
.
- Ensure the raycast’s maximum distance is the light radius.
This one is easy and if you’re talking about raycast’s maximum distance then I think you mean the raycast event with the angle but like I mentioned above I don’t know what to put in the angle section?
At the moment I’m stuck here:
What does it do basically is change the player color when he is in the light but not when he is under the platform again and it’s far from being accurate but at least it’s a start…
Anyway I’ll be waiting for your answers and explanation on what to do next and if you have an example or if you could make a quick example yourself explaining this I’d really appreciate it.
Also if you want the project file I can send it to you so you test it yourself and add to it and so on…
Anyway I’m waiting for your input on this…
Thanks for helping.