Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Mar 14, 2017 at 12:10 PM by uni-ToZoR for the following reason:

I solved this problem by myself.

avatar image
0
Question by uni-ToZoR · Oct 17, 2016 at 03:52 PM · 2d game

Fog of war for a 2D game.

Hi,

i'm a beginner on Unity. I'm currently working on a simple 2D RPG game with a top view system who follow my player object on a "map scene". I'm looking for a solution to create a fog of war on the map and i don't know how to do it. I read some post and watched some tutorial but i can't find a solution yet. Don't know if i need to use shader or mesh or an other way...

If someone can help me, he will be a hero ^^

Thanks in advance!

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cherno · Oct 17, 2016 at 03:57 PM 0
Share

Generate a mesh over the terrain, and give it a shader which supports vertex colors. Set the vertex colors to black. When exploring, set the vertex color of the nearest vertices to alpha 0.

Lots of tutorials for this, some also use special shaders.

avatar image uni-ToZoR Cherno · Oct 17, 2016 at 04:40 PM 0
Share

Thanks for your quick answer, but i'm just using Sprite right now and i can't use mesh on it... I maybe don't use the good way, as i say i'm a beginner in Unity and i don't know how tu use many of 3d element.

avatar image Cherno uni-ToZoR · Oct 17, 2016 at 08:09 PM 0
Share

It doesn't matter if you use sprites or not. In Unity, a sprite is still just a mesh (quad), and so is 2d tiled terrain.

3 Replies

  • Sort: 
avatar image
-1

Answer by b1gry4n · Oct 17, 2016 at 06:10 PM

Google is your friend.

http://answers.unity3d.com/questions/766534/how-to-make-a-fog-of-war-with-textures.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by uni-ToZoR · Oct 17, 2016 at 06:41 PM

Thanks for your reply, But i already find that post and saw this tutorial, i don't know how to use it in a 2D project... I don't know how to use plane in a 2D environement. i can't get it visible even if i rotate it. That's my problem.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by uni-ToZoR · Oct 17, 2016 at 06:41 PM

Hi, thanks, but i already this this post and the tutorial, but it's for 3D environement and i work in a 2D project, i don't know how to use element like plane, if i rotate it, it does not appear. i really don't know how to use in 2d...

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Necktron · Apr 28, 2017 at 09:26 AM 1
Share

How did you solve this? Im having the same trouble

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

2D snake game stop sprite from leaving screen 1 Answer

Pixels Warped/Distorted - Nothing Has Worked So Far 2 Answers

Display "Typewriter Text Effect" when a bool is set to true in another script. 0 Answers

[2D]Tank track animation 0 Answers

Arrays? ↓↓↓↓↓↓↓ 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges