Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Same function not working the same in different script

$
0
0
Hi guys

I have the exact same function working on one gameobject that shoots in the direction of the player.
But the same function on another object it doesnt seem to work properly, if anybody could give me an idea why it would be great.

Code (CSharp):
  1. if (dist < randomDistance && isAlive && playerScript.isAlive)
  2.         {
  3.             followingPlayer = true;
  4.             if (Time.time > lastTimeShot + shootingDelay && playerScript.isAlive)
  5.             {
  6.                 lastTimeShot =...
Same function not working the same in different script

Viewing all articles
Browse latest Browse all 1466670

Trending Articles