Guest User

Untitled

a guest
Mar 13th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Soldier : MonoBehaviour {
  6. private GameObject mEnemy;
  7.  
  8. // Use this for initialization
  9. void Start () {
  10. //Move to the left
  11. mEnemy = transform.GetChild(0).gameObject;
  12.  
  13. //Get enemy position and use trig function to move it
  14. Vector3 enemyPos = mEnemy.transform.position;
  15. enemyPos.z += Mathf.Cos(0.1f);
  16.  
  17. iTween.MoveTo(mEnemy, enemyPos, 2.0f);
  18.  
  19. }
  20.  
  21. // Update is called once per frame
  22. void Update () {
  23.  
  24. }
  25. }
Add Comment
Please, Sign In to add comment