Created
March 4, 2018 02:06
-
-
Save giljr/339e2ca283e092e0063bfd5b372f9d3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Soldier : MonoBehaviour { | |
private GameObject mEnemy; | |
// Use this for initialization | |
void Start () { | |
//Move to the left | |
mEnemy = transform.GetChild(0).gameObject; | |
//Get enemy position and use trig function to move it | |
Vector3 enemyPos = mEnemy.transform.position; | |
enemyPos.z += Mathf.Cos(0.1f); | |
iTween.MoveTo(mEnemy, enemyPos, 2.0f); | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment