How do I fix the shadow caster hide some sprites?

Get help using Construct 2

Post » Wed May 03, 2017 8:57 pm

The problem with shadow caster is that you need to put the light under the sprite to not hide but then when you use dinamic lights they not hide the sprites that are in the shadow of other object.

Here an example of the prototype i'm working :

Image

That box in the bottom needs to be hiden, how i fix that? Is there any way to set that if a shadow of other object overlaps other hide this one or apear over them or something?
B
24
S
10
G
3
Posts: 557
Reputation: 4,491

Post » Thu May 04, 2017 9:44 am

You can use Line Of Sight behaviour to hide things the player can't see by setting them to invisible.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Thu May 04, 2017 11:01 am

No works because the objects to hide are the same ones that blocks the line of sight so never is visible :( , i don't know if i'm explaining well.

For line of sight you set wich objects acts as "block" and the box is a sprite that have to block and one that have to be hidden.

Also even if there is someway to fix that no matters because, what happens when the shadows have to hide some part of the sprite? With line of sight the sprite is visible or not, in the example will be ok, but if the shadows only gets half of the box will appear entirely so still not will be 100% correct. :S .
B
24
S
10
G
3
Posts: 557
Reputation: 4,491

Post » Thu May 04, 2017 11:34 am

Ok, yeah I think I know what you mean now.

I don't think there's an easy way to do what you want... Shadowcaster is a little bit limited I guess in certain ways, and there's been a lot of requests over time to add improvements to it. I worked on making my own shadow system some time ago, but it wasn't very efficient and caused a lot of CPU usage so I gave up in the end.

I'm not sure if there's a good way to do this - but I'm sure someone here will prove me wrong, lol!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Thu May 04, 2017 12:03 pm

This can be solved in a easy way if shadows works like:

Always above sprites but the cast starting out the sprite instead of inside.

The problem now is the shadow caster make the collision poligon with shadow so you have to put the light under the sprites and appears problem like this.
B
24
S
10
G
3
Posts: 557
Reputation: 4,491


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dand, tinhofiel and 29 guests