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

Cant make enemy shoot in players direction

$
0
0
Hi guys,

Battling to get the enemy to shoot in the players general direction, works sometimes, but is mostly shooting 90 degrees to the right or up.

this is the code im using:

Code (CSharp):
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class UfoTorpedoController : MonoBehaviour
  6. {
  7.     float moveSpeed = 200;
  8.  
  9.     Rigidbody rb;
  10.  
  11.     public Transform target;
  12.     Vector2 moveDirection;
  13.  
  14.     void Start()
  15.     {
  16.         rb = GetComponent<Rigidbody>();...
Cant make enemy shoot in players direction

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>