Problem with Default Render Pipeline #120
-
Hi, Firstly, Edgar is awesome! I'm very new to Unity and I'm in the process of making my first game. I'm having a bit of trouble setting up the Fog of War feature. I get this error but I'm using the Default Render Pipeline. The Fog of War feature is enabled but the shader was not yet applied. It seems like you are using URP or LWRP and did not add the custom render feature. Please visit the documentation to see which additional steps are needed to enable this feature in URP and LWRP. I am also using Smart 2D lighting so this may have something to do with the problem. Any help would be awesome, |
Beta Was this translation helpful? Give feedback.
Replies: 15 comments 15 replies
-
Hello! I think you might be missing the "FogOfWarGrid2D.Setup()" call somewhere in your post-processing logic. It needs to be called each time a level is generated. It's described here: https://ondrejnepozitek.github.io/Edgar-Unity/docs/guides/fog-of-war/#add-custom-post-processing-logic Let me know if it helps! |
Beta Was this translation helpful? Give feedback.
-
Hi Ondrej,
The Fog Of War works the Gungeon scene and the FogOfWar scene.
I used the scripted Object from Create/Edgar/Examples/Fog of
War/Post-processing. All I did was change the find tag from "Player" to my
characters tag.
I then put the FogOfWarPostProcessing SO file into the Generators Custom
Post Process task.
Am I missing a step somewhere or do I have to change some of the code in
the FogOfWarPostProcessing SO file. I'm very new to scripting so I don't
know what *" missing the "FogOfWarGrid2D.Setup()" call somewhere in your
post-processing logic" *means.
I redid the whole process again and I'm not getting the error message
anymore but the Fog Of War is still not working.
…-Dan.
|
Beta Was this translation helpful? Give feedback.
-
The Fog is there now and has revealed the first room but it doesn't reveal
the next room. I have set up colliders in the corridors with the Fog Of War
Trigger script from the documentation and changed the tag to my players tag
and set it to "Is Trigger"
It doesn't reveal the rooms in play mode.
I'm not sure what to type to do a Debug.Log message, sorry.
…On Tue, 25 Apr 2023 at 03:20, Ondřej Nepožitek ***@***.***> wrote:
So after you redid it there's no warning/error in the console? You have
the FogOfWarGrid2D component attached to the main camera, right? And you're
using this post-processing script?
https://ondrejnepozitek.github.io/Edgar-Unity/docs/guides/fog-of-war/#add-custom-post-processing-logic
By "Fog of War is still not working" you mean that nothing is covered in
the fog? In the post-processing script you can add some Debug.Log message
after FogOfWarGrid2D.Instance.Setup(generatedLevelRoot, player.transform);
to make sure that it's called after the level is generated. Also, you need
to be in the play mode for the fog to work. And really double check any
errors in the console.
—
Reply to this email directly, view it on GitHub
<#120 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A46AEXOFB32YX2TAEYLSVG3XC24P5ANCNFSM6AAAAAAXHXKTWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
Yes, I have done all of that.
I just checked and I had the error messages were turned off in the
console 😅
This is what I get when I walk into the trigger collider. There seems to be
an error but I don't know how to fix it.
[image: image.png]
Here is the collider set up as well if that helps.
[image: image.png]
…On Tue, 25 Apr 2023 at 15:38, Ondřej Nepožitek ***@***.***> wrote:
If the rooms are not revealed then it's another kind of "not working". The
fog works but your room detection setup probably has some problems because
new rooms are not revealed. Did you add FogOfWarExampleTriggerHandler to
your corridor room templates? You also need to make sure to add a RigidBody
and a Collider to that same game object to which you added
FogOfWarExampleTriggerHandler. Also, check if there are any errors in the
console when you enter a room. Sometimes, there's a problem with colliders
not triggering due to being set up incorrectly. You have to make sure that
the collider triggers when the player enters it.
—
Reply to this email directly, view it on GitHub
<#120 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A46AEXL7OXXSIJBA2NW6EULXC5S7HANCNFSM6AAAAAAXHXKTWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
oh, the error is...
MissingReferenceException: The object of type 'Transform' has been
destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the
object.
Edgar.Unity.FogOfWarGrid2D.RevealRooms
(System.Collections.Generic.List`1[T] rooms, System.Nullable`1[T]
waveOrigin, System.Boolean revealImmediately) (at
Assets/ThirdParty/Edgar/Runtime/Grid2D/Common/FogOfWar/FogOfWarGrid2D.cs:267)
Edgar.Unity.FogOfWarGrid2D.RevealRoomAndNeighbors
(Edgar.Unity.RoomInstanceGrid2D room, System.Nullable`1[T] waveOrigin,
System.Boolean revealImmediately) (at
Assets/ThirdParty/Edgar/Runtime/Grid2D/Common/FogOfWar/FogOfWarGrid2D.cs:251)
Edgar.Unity.Examples.FogOfWarExample.FogOfWarExampleTriggerHandler.OnTriggerEnter2D
(UnityEngine.Collider2D otherCollider) (at
Assets/ThirdParty/Edgar/Examples/Grid2D/FogOfWarExample/Scripts/FogOfWarExampleTriggerHandler.cs:37)
…On Wed, 26 Apr 2023 at 00:24, Ondřej Nepožitek ***@***.***> wrote:
It looks like the images don't load for me.
—
Reply to this email directly, view it on GitHub
<#120 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A46AEXJJVVE2OSS2FGQMPCLXC7QS7ANCNFSM6AAAAAAXHXKTWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
Its on Fade In.
…On Thu, 27 Apr 2023 at 01:11, Ondřej Nepožitek ***@***.***> wrote:
In the FogOfWar component on your camera, which Mode do you have? Wave or
FadeIn?
—
Reply to this email directly, view it on GitHub
<#120 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A46AEXMHX2IRMJAHPG7XA7LXDE63NANCNFSM6AAAAAAXHXKTWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
I tried the Wave mode and got this error
ArgumentException: When the Wave mode is used, either the waveOrigin that
is passed to this method or that is used in the Setup() method must not be
null.
Edgar.Unity.FogOfWarGrid2D.RevealRooms
(System.Collections.Generic.List`1[T] rooms, System.Nullable`1[T]
waveOrigin, System.Boolean revealImmediately) (at
Assets/ThirdParty/Edgar/Runtime/Grid2D/Common/FogOfWar/FogOfWarGrid2D.cs:268)
Edgar.Unity.FogOfWarGrid2D.RevealRoomAndNeighbors
(Edgar.Unity.RoomInstanceGrid2D room, System.Nullable`1[T] waveOrigin,
System.Boolean revealImmediately) (at
Assets/ThirdParty/Edgar/Runtime/Grid2D/Common/FogOfWar/FogOfWarGrid2D.cs:251)
Edgar.Unity.Examples.FogOfWarExample.FogOfWarExampleTriggerHandler.OnTriggerEnter2D
(UnityEngine.Collider2D otherCollider) (at
Assets/ThirdParty/Edgar/Examples/Grid2D/FogOfWarExample/Scripts/FogOfWarExampleTriggerHandler.cs:37)
On Thu, 27 Apr 2023 at 21:00, Dan McGuiness ***@***.***>
wrote:
… Its on Fade In.
On Thu, 27 Apr 2023 at 01:11, Ondřej Nepožitek ***@***.***>
wrote:
> In the FogOfWar component on your camera, which Mode do you have? Wave
> or FadeIn?
>
> —
> Reply to this email directly, view it on GitHub
> <#120 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A46AEXMHX2IRMJAHPG7XA7LXDE63NANCNFSM6AAAAAAXHXKTWA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***
> .com>
>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
It worked!!!
Awesome work!
Thanks heaps for the help.
All the best,
Dan.
…On Thu, 27 Apr 2023 at 21:44, Ondřej Nepožitek ***@***.***> wrote:
Yeah, I investigated this yesterday and there was a small bug. If you open
the FogOfWarGrid2D.cs file, you can replace the RevealRooms method with
the following code (it should be around line 260 in that file):
public void RevealRooms(List<RoomInstanceGrid2D> rooms, Vector3? waveOrigin = null, bool revealImmediately = false)
{
if (Mode == FogOfWarMode.Wave && waveOrigin == null && WaveOrigin == null)
{
throw new ArgumentException($"When the {FogOfWarMode.Wave} mode is used, either the {nameof(waveOrigin)} that is passed to this method or that is used in the Setup() method must not be null.");
}
var playerPosition = Mode == FogOfWarMode.Wave
? waveOrigin ?? WaveOrigin.transform.position
: Vector3.zero;
StartCoroutine(RevealRoomCoroutine(rooms, playerPosition, revealImmediately));
}
This will be shipped in the next update.
If you wanted to use the Wave mode, you need to pass your player transform
to the FogOfWar.Setup() function because the Fog needs to know from which
direction to reveal the tiles. But the FadeIn mode should be fine if you do
that manual patch in the file.
—
Reply to this email directly, view it on GitHub
<#120 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A46AEXJXFAGV3UCQPWMYNCDXDJPIXANCNFSM6AAAAAAXHXKTWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
Hi Ondrej,
I have been following the new documentation on how to set up spawning
enemies and locked doors until the enemies are dead.
I got this error when changing the GungeonRoomManager script like it says
to do in the documentation. Is it because I'm missing an assembly
reference? or something else?
[image: image.png]
On Thu, 27 Apr 2023 at 22:11, Dan McGuiness ***@***.***>
wrote:
… It worked!!!
Awesome work!
Thanks heaps for the help.
All the best,
Dan.
On Thu, 27 Apr 2023 at 21:44, Ondřej Nepožitek ***@***.***>
wrote:
> Yeah, I investigated this yesterday and there was a small bug. If you
> open the FogOfWarGrid2D.cs file, you can replace the RevealRooms method
> with the following code (it should be around line 260 in that file):
>
> public void RevealRooms(List<RoomInstanceGrid2D> rooms, Vector3? waveOrigin = null, bool revealImmediately = false)
> {
> if (Mode == FogOfWarMode.Wave && waveOrigin == null && WaveOrigin == null)
> {
> throw new ArgumentException($"When the {FogOfWarMode.Wave} mode is used, either the {nameof(waveOrigin)} that is passed to this method or that is used in the Setup() method must not be null.");
> }
>
> var playerPosition = Mode == FogOfWarMode.Wave
> ? waveOrigin ?? WaveOrigin.transform.position
> : Vector3.zero;
>
> StartCoroutine(RevealRoomCoroutine(rooms, playerPosition, revealImmediately));
> }
>
> This will be shipped in the next update.
>
> If you wanted to use the Wave mode, you need to pass your player
> transform to the FogOfWar.Setup() function because the Fog needs to know
> from which direction to reveal the tiles. But the FadeIn mode should be
> fine if you do that manual patch in the file.
>
> —
> Reply to this email directly, view it on GitHub
> <#120 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A46AEXJXFAGV3UCQPWMYNCDXDJPIXANCNFSM6AAAAAAXHXKTWA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***
> .com>
>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
oh damn!
I attached it this time as a jpeg.
the errors are:
Assets\ThirdParty\Edgar\Examples\Grid2D\Gungeon\Scripts\GungeonRoomManager.cs(23,21):
error CS0246: The type or namespace name 'GungeonEnemy' could not be found
(are you missing a using directive or an assembly reference?)
Assets\ThirdParty\Edgar\Examples\Grid2D\Gungeon\Scripts\GungeonRoomManager.cs(17,10):
error CS0246: The type or namespace name 'FormerlySerializedAsAttribute'
could not be found (are you missing a using directive or an assembly
reference?)
Assets\ThirdParty\Edgar\Examples\Grid2D\Gungeon\Scripts\GungeonRoomManager.cs(17,10):
error CS0246: The type or namespace name 'FormerlySerializedAs' could not
be found (are you missing a using directive or an assembly reference?)
…On Mon, 15 May 2023 at 02:26, Ondřej Nepožitek ***@***.***> wrote:
Hey, the image didn't load again so I cannot see the error.
—
Reply to this email directly, view it on GitHub
<#120 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A46AEXMSHLWTHRI7EUY2IFLXGEFE5ANCNFSM6AAAAAAXHXKTWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
Oh cool. I added 'using UnityEngine.Serialization;' and that fixed the
Unity errors.
I then added the using Edgar.Unity.Examples.Gungeon; but it still get the
Gungeon errors.
Hopefully you can see the image I attached.
…On Mon, 15 May 2023 at 15:35, Ondřej Nepožitek ***@***.***> wrote:
FormerlySerializedAsAttribute is an attribute from Unity and for
GungeonEnemy you should have using Edgar.Unity.Examples.Gungeon;. You
should usually use an IDE that can suggest these changes if some using
statements are missing.
—
Reply to this email directly, view it on GitHub
<#120 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A46AEXP5HEMHHK2KIBJBMFDXGHBSVANCNFSM6AAAAAAXHXKTWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
I don't have GungeonEnemy.cs.
That could be the problem.
…On Mon, 15 May 2023 at 16:03, Ondřej Nepožitek ***@***.***> wrote:
Unfortunately, still no image.
Can you check that you have the file at
"Examples/Grid2D/Gungeon/Scripts/GungeonEnemy.cs"? In theory, you shouldn't
even need that using statement because the two files should be in the same
namespace. So maybe there's a problem with that GungeonEnemy file not being
there? Or you can also check the content of the file if the class is named
correctly.
—
Reply to this email directly, view it on GitHub
<#120 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A46AEXJ4XS4QX544C322MCLXGHE2LANCNFSM6AAAAAAXHXKTWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Dan McGuiness
Writer - Illustrator - Videographer - Video Editor - Director - Awesome
Dude
Ph: 0401 948 313
Greenlight Comics <http://www.greenlightcomics.com/>
danmcguiness.com.au
IMPORTANT NOTICE
This email, including all attachments, is confidential and copyright. If
you are not the named recipient you must not use or copy or disclose it to
any person.
|
Beta Was this translation helpful? Give feedback.
-
I installed Edgar on a new project. I then copied all the Gungeon scripts over to my current project. That fixed up all the problems. Thank you for going through this with me. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
I saw that you have the asset at a custom location. Is it possible that you somehow lost the file when moving the asset? You can always import Edgar in another project and make sure that you have all the files in your current project.