How do i make the raycast angle change based on the rotation of the enemy

Red is only for me

Green is how far player can be from enemy to detect player
Yellow is range of your vision cone
If you want it to be wider you need to set BOTH values to -50 and 50 for example
They always need to be the same number with one be negative
You want to have slimmer cone then for example to -15 and 15

You can drag blocks and ballz with mouse to test different angles

3 Likes