Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

It seems it doesn't like stairs. The resurouces get higher in places like this. I tried to make with rectangles with box colliders but seems not help. So far I came up with something like a solution(I don't like it much), I make a separate collider for the light like with spikes to the points of stairs. But at least it works faster that way. 

Maybe there is a better solution for situations like this?

P.S.
Amazing script anyway.

Didn't really understand what was the problem that made you add spikes for the stairs. Couldn't reproduce any graphical glitch on my end.

Unfortunately, performance does go down the more complex a scene becomes.
Assuming you're using a Tilemap/Composite Collider combo, the only advice I could give is to separate your map into chunks (like the image below).
This way, the light only has to take the relevant vertices into account, instead of validating vertices far away and not in range.

I'm not sure if the light source in your image is your rock-character or that triangle-shaped fire (?).
If it's the latter (and your character doesn't cast shadows), it's a good idea to activate the Calculate Only Once check under the Optimization Settings. This will "bake" the light mesh on the first frame and you won't have to worry about performance anymore.

Hope this helps somewhat 💦
If you got more questions, please let me know 👌


I have a question. How did you made such simple collider shape for the stairs?
I am kinda noob and I just use sprite shaper to create a level. Here is a video from the screen:

In levels I often have smooth walls. For the light I make a copy of a level with low quality for shaping:

(+1)

Oh, you're using sprite shaper 😮
Can't say I've ever used it, but it seems to use either a Polygon or Edge Collider, right?
I'd say the same advice would apply. Just break your level into smaller chunks (i.e. have a game object for the spawning area, another for the slide, another for the ceiling, etc.).

About my stairs you shouldn't worry about. I thought you were using a tile map.
This by default gives you a grid of colliders for every tile (very bad and not supported by my asset) and once you use a Composite Collider (very good and supported by my asset) you end up with the shape you saw on my first reply.

If your setup is causing you problems maybe try using an Edge Collider instead of Poly? (dunno if your character might fall through if framerates go bad tho) 
Just remember to refresh the colliders every time you update your shape.
Don, sorry 💦

 

(+1)

Oh... That composite collider seems an awesome thing! I added it to the level shape and it created much more simple collider shape!
Thanks so much!