Flashlight should stops AI movement, then resume movement when flashlight isn't shining on them

Sorry i have been away from this thread so long. I let my inbox get flooded with too many answerhub notifications and so i recently turned off most of them.

It is hard to tell whats wrong here but it might help with troubleshooting if you move the logic out of the flashlight and into the monsters since they are the ones who care whether the flashlight is shining on them. The flashlight doesnt need to know anything about monsters. You can do it that way but it makes it more complicated.

If a trace from the monster toward the flashlight hits the flashlight, and the flashlight rotation is within -0.2 dot product of the monster’s trace direction, then the flashlight is facing the monster or close to it and the monster can tell itself to freeze---- or unfreeze if the trace is out of range or a dot product of less than -0.2 or more than 0.

That way you dont have to do complicated gates and loops because each monster handles its own freezing and unfreezing.

1 Like