enemy shoots faster as it gets closer to player
as the enemy gets closer it shoots faster... here is my script :) (im super new and this is the first project ive done where ive used minimal tutorials)
[1]: /storage/temp/154750-help-enemyshootsfasterwhencloser.png
Answer by jono56667 · Mar 22, 2020 at 05:03 AM
ok so i fixed it but probably a really backwards way cos i was just testing things until it worked, i put a bool for playerinrange as the raycast detected the player and set it to true when that happened. than initiated the shoot() lines than added a coroutine that wait 0.5 seconds and set the playerinrange to false. but if the raycast it still on the player it will set the playerinrange bool to true again and repeat until the player is no longer in range.
... scale of 1 to what the f**k did you just say, how did i do
Your answer
Follow this Question
Related Questions
Raycast is going through collider (A plane) 0 Answers
Adding MaxDistance to RayCast Stops Raycast From working 0 Answers
Accessing Raycast collider from another script 0 Answers
How to make an object shoot a projectile? 4 Answers
Raycast help 0 Answers