daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top