Skip to content

Commit

Permalink
Fix alien targetting
Browse files Browse the repository at this point in the history
  • Loading branch information
tbigfish committed Nov 28, 2014
1 parent bee68e5 commit 25d2790
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Assets/Scripts/Enemies/ProjectileAttack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ void Update()
lastShot = Time.time;

//Build a ray to shine at the player
Vector3 playerColliderLoc = PlayerController.collider.transform.position;
Vector3 playerColliderLoc = PlayerController.ClosestPointOnBounds(this.transform.position);

////A bit nasty - stops the raycast hitting the floor at the player's feet
//playerColliderLoc.y += Player.transform.localScale.y;

//A bit nasty - stops the raycast hitting the floor at the player's feet
playerColliderLoc.y += Player.transform.localScale.y;
Vector3 playerDirection = playerColliderLoc - this.transform.position;
Ray newRay = new Ray(this.transform.position, playerDirection);
RaycastHit info;
Expand Down

0 comments on commit 25d2790

Please sign in to comment.