PlayMaker Updates & Downloads > Share New Actions

Set Enemy/npc (or player) Fov 3d or 2d

(1/10) > >>

dudebxl:
6 types of FOV actions (3d / 2d):

(1) Simple Fov without physics (see attached pict):
- Set Enemy Fov 2d
- Set Enemy Fov 3d
- Set Enemy Fov 2d by tag
- Set Enemy Fov 3d by tag

How does it work: Set your FOV and set your target by gameobject. If the target is in the FOV then bool is set to true and/or send event. Click on object with action to see visual FOV.

(2) Dynamic Vision Cone Fov (see attached pict):
- Dynamic Vision Cone Fov
- Dynamic Vision Cone Fov 2D

How does it work: Will draw a FOV Mesh and uses physics. You can set different states to the FOV (attack or idle, etc - by int). Set your target by gameobject or tag.  If the target is in the FOV then bool is set to true. Read tooltips for more info.

Any issues or problems, please post here.

On ecosystem (for quick search: fov) or https://snipt.net/dudebxl/

tip: activate gizmo in game mode and you should see the debug lines.


Special thanks and original code snippet by: Dima Kurilchenko, AnomalusUndrdog, pencilsquaregames

foxdeltagames:
The "Set Enemy FOV 3D" doesnt have a tag option for the target, only a game object option for the target.

Also the dynamic 3D and the gizmo for that works, but for some reason it doesn't point in the same direction the parent game object is pointing too.

https://gyazo.com/0eaff6cdf9cbc242500b0ed769c5ab4b
https://gyazo.com/80189841d70cf134253b65ccd7c782ff

dudebxl:
1. Sorry, my mistake, Set Enemy Fov 3d does not have tag. I have corrected intro text was confusing with the other action.

2. I did a test and on my side it works. Gizmo (ref: 'Set Enemy Fov 3d' action) is only in scene view and you have to select the object with action to see it. If you want to auto point towards target make sure autoRotate is off. (now auto in v1.1).

3. Also re-tested dynamic 3D and it is working on my side (I can rotate it by rotating the game object with the action (example: Y: 90) and it points in the right direction). I notice you have in picture (80189841d70cf134253b65ccd7c782ff) transform rotate at 90 which you do not have in the other picture and the purple is because you are missing a material. Please try again the rotation with the gameobject that has the action or send a picture you action settings.

and thanks for the feedback, always good to see if things are working or not.

foxdeltagames:
For the"Set Enemy FOV 3D", by any chance can you add a tag target option for that action? everything works fine with that action, but no way to tell the action what game object to look for without having to actually drop the game object in target option. I do have a few different game objects that are NOT named the same, but uses the same tag, so it will make it really hard to use this action, even more some of the game objects are prefabs that are loaded in via when the game loads and are not in the scene.

dudebxl:
@foxdeltagames

I had a think and it will not benefit the action because I then need to create an array, etc. This is a simple action for example 5x enemies walking around looking for the player (target). Player enters enemy FOV, do something. Or a player is looking for something (target) and when it enters player fov, do something.

If you have many targets then the Dynamic Vision Cone Fov is the way (use a transparent material if you do not want a visible mesh or turn it off - not tried) or you build your own 'rules' such as enemy enters a collider, change/set game object target variable and if in fov do something.

Navigation

[0] Message Index

[#] Next page

Go to full version