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:
Cant make enemy shoot in players direction
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):
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class UfoTorpedoController : MonoBehaviour
- {
- float moveSpeed = 200;
- Rigidbody rb;
- public Transform target;
- Vector2 moveDirection;
- void Start()
- {
- rb = GetComponent<Rigidbody>();...