"how to make enemy go in one direction unity 2d" Code Answer's

You're definitely familiar with the best coding language Go that developers use to develop their projects and they get all their queries like "how to make enemy go in one direction unity 2d" answered properly. Developers are finding an appropriate answer about how to make enemy go in one direction unity 2d related to the Go coding language. By visiting this online portal developers get answers concerning Go codes question like how to make enemy go in one direction unity 2d. Enter your desired code related query in the search bar and get every piece of information about Go code related question on how to make enemy go in one direction unity 2d. 

how to make enemy go in one direction unity 2d

By Brave BoobyBrave Booby on Dec 07, 2020
 using System.Collections; using System.Collections.Generic; using UnityEngine;  public class EnemyPatrol : MonoBehaviour {     public float speed;     public float distance;      private bool movingRight = true;      public Transform groundDetection;      void Update()     {         transform.Translate(Vector2.right * speed * Time.deltaTime);          RaycastHit2D groundInfo = Physics2D.Raycast(groundDetection.position, Vector2.down, distance);         if (groundInfo.collider == false)         {             if (movingRight == true)             {                 transform.eulerAngles = new Vector3(0, -180, 0);                 movingRight = false;             }             else             {                 transform.eulerAngles = new Vector3(0, 0, 0);                 movingRight = true;             }                    }         private void OnCollisionEnter2D(Collision2D collision)     if (collide.collider.gameObject.tag == "Wall")         {             Debug.Log("E");             if (movingRight == true)             {                 transform.eulerAngles = new Vector3(0, -180, 0);                 movingRight = false;             }             else             {                 transform.eulerAngles = new Vector3(0, 0, 0);                 movingRight = true;             }          }     } }

Source: answers.unity.com

Add Comment

0

All those coders who are working on the Go based application and are stuck on how to make enemy go in one direction unity 2d can get a collection of related answers to their query. Programmers need to enter their query on how to make enemy go in one direction unity 2d related to Go code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about how to make enemy go in one direction unity 2d for the programmers working on Go code while coding their module. Coders are also allowed to rectify already present answers of how to make enemy go in one direction unity 2d while working on the Go language code. Developers can add up suggestions if they deem fit any other answer relating to "how to make enemy go in one direction unity 2d". Visit this developer's friendly online web community, CodeProZone, and get your queries like how to make enemy go in one direction unity 2d resolved professionally and stay updated to the latest Go updates. 

Go answers related to "how to make enemy go in one direction unity 2d"

View All Go queries

Go queries related to "how to make enemy go in one direction unity 2d"

Browse Other Code Languages

CodeProZone