Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class MossGiant : Enemy // inherits from the Main Enemy Class
- {
- // Use this for initialization
- private void Start()
- {
- }
- // Update is called once per frame
- public override void Update()
- {
- if(transform.position == pointA.position)
- {
- print("pointA");
- transform.position = Vector3.MoveTowards(transform.position, pointB.position, speed * Time.deltaTime);
- }
- else if(transform.position == pointB.position)
- {
- print("pointB");
- transform.position = Vector3.MoveTowards(transform.position, pointA.position, speed * Time.deltaTime);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement