How do I stop light from pushing through shadow objects?

0 favourites
  • 7 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I use the shadow light object to contain light inside the walls. The walls cast shadows so it stops the light. However due i think to the size of the SLO, if i push at the wall, the object pokes through the wall, meaning that the wall stops acting as an object with shadowcaster on it. See picture attached.

    Is there a way to stop this please? It looks really bad. Can i resize the SLO or put it on another layer or anything?

    Thank you, Kenthria

  • How close do you have to get to the wall before it pushes through?

    Maybe you can extend the collision box for your character so you can't get super close... or move the light object "back" a couple of pixels?

    ~Sol

  • How close do you have to get to the wall before it pushes through?

    Maybe you can extend the collision box for your character so you can't get super close... or move the light object "back" a couple of pixels?

    ~Sol

    Pretty close. I use points that are invisible around the diver to detect the collisions (works for mining etc)- so i could have the collision points further from the diver- however it would give little room.

    How would I move the light object back a few pixels? On collisions with the wall?

    Thanks.

  • Yeah maybe test for overlap at offset with the wall tile - so you might need to check in a radius or each direction in a square.

    If offset is compared at say X + 1 (or even X+2) then move light to self.X-1

    Do this for each direction or use some trigonometry to calculate the radius

    That should work, I think!

    ~Sol

  • Yeah maybe test for overlap at offset with the wall tile - so you might need to check in a radius or each direction in a square.

    If offset is compared at say X + 1 (or even X+2) then move light to self.X-1

    Do this for each direction or use some trigonometry to calculate the radius

    That should work, I think!

    ~Sol

    I will try this thanks! Will post how it goes.

  • OK sounds great

    It might not be the BEST solution, but it might work around the problem for now at least (if it works)!

    ~Sol

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Works well thanks a lot

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)