This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

OcularCash

Breakaway Building Opinion

13 posts in this topic

So I'm wanting to do a breakaway building kind of like what you see in some of the old 2d games. Full building from the outside and the roof breaks off when you enter it, Only I'm doing it in 3d. I think it looks good but what do you think if instead of it breaking completely off, just turn the alpha channel to 0.1 or so, that way you can still see the roof but also see on the inside. What's your opinion?

Please login or register to see this attachment.

Share this post


Link to post
Share on other sites

With transparent roof:

Please login or register to see this attachment.

2 people like this

Share this post


Link to post
Share on other sites

I think the one with the transparent roof looks great! In game to me it would probably look weird to have the roof just simply disappear, but with the transparent roof you could just fade out the transparency.....which could then have the opacity to 0 and then the roof not be there... Sorry Rambling to myself at this point. Either way it will look fine if you have a little fade transition. To me tho, the transparent one looks better.

Share this post


Link to post
Share on other sites

Please login or register to see this attachment.

Please login or register to see this attachment.

Share this post


Link to post
Share on other sites

I'm thinking of implementing this into my project for when my played walks behind big tree's and buildings. How did you achieve this?

 

Edit: I know how to make the object transparent, but how would you check if the player is behind a 2d object??

Share this post


Link to post
Share on other sites
Please login or register to see this quote.

You could use a raycast, and check if it hits the player or a different object.

1 person likes this

Share this post


Link to post
Share on other sites

Could I send a ray on the Z axis on a 2D sprite?

Share this post


Link to post
Share on other sites

If your game is tilebased, just check your tilemap at the four corners and center of the sprite only if the center of the sprite has changed it's position by an int from the previous frame. It's cheaper to read all the corners and center having access to all the colliding sprites than it is to use a raycast to detect a single collider, can detect more than one layered sprites in a tilemap, doesn't require any getting of components because your using the tilemap, etc, etc...

 

If your not using a tileset, not sure what is available for unity's 2D system. If you use mesh sprites like me, you could use a boxcast by comparing bounds (instead of using  a bunch of raycasts or other heavy physics method). If you using unity sprites, not sure what you can do besides raycasting multiple times or possibly boxcasting (if sprites even use 3d bounds)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now