Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Migsterium on October 12, 2020, 03:02:57 PM

Title: How to limit player vision in an isometric 2D game?
Post by: Migsterium on October 12, 2020, 03:02:57 PM
Hi there! I'm working on a demo for an adventure horror game where you explore a cursed Aztec temple and I'd like to add a cone-of-vision gameplay mechanic. Basically, I want to have a clear visual representation of the player's field of vision and I need for my game objects (mainly enemies and important items) outside the field of vision to disappear from the game world when the player is NOT looking at them.

Can anyone help me achieve this using Playmaker?

I've attached a screenshot from the game Darkwood to help illustrate what I'm trying to accomplish.
Title: Re: How to limit player vision in an isometric 2D game?
Post by: djaydino on October 12, 2020, 04:46:43 PM
Hi.

If 2D you can use Sprite mask component.

If 3D you need to look into shaders.

Title: Re: How to limit player vision in an isometric 2D game?
Post by: Migsterium on October 12, 2020, 04:50:02 PM
Hi.

If 2D you can use Sprite mask component.

If 3D you need to look into shaders.

I'm sorry, but could you elaborate? I'm not sure how that works. It's the first time I'm using this tool.
Title: Re: How to limit player vision in an isometric 2D game?
Post by: djaydino on October 12, 2020, 05:02:33 PM
Hi.
For this it does not matter if you use playmaker or not :)


For 3D its a bit more difficult as you need to code a shader :

https://forum.unity.com/threads/obscuring-specific-3d-objects-with-specific-3d-mask-objects.467999/

https://answers.unity.com/questions/1553334/masking-a-3d-object-using-a-3d-volume.html