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 MoveUP : MonoBehaviour {
- public float speed = 2f;
- bool flagvalue = false;
- // Use this for initialization
- void Start () {
- }
- public void Move3DobjectUP()
- {
- gameObject.SetActive (true);
- flagvalue = true;
- }
- // Update is called once per frame
- void Update () {
- if (flagvalue) {
- transform.Translate (Vector3.up * Time.deltaTime * speed);
- }
- if (gameObject.transform.position.y > 1) {
- gameObject.SetActive (false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement