Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class MoveUP : MonoBehaviour {
  6. public float speed = 2f;
  7. bool flagvalue = false;
  8.  
  9. // Use this for initialization
  10. void Start () {
  11.  
  12. }
  13. public void Move3DobjectUP()
  14. {
  15. gameObject.SetActive (true);
  16. flagvalue = true;
  17. }
  18. // Update is called once per frame
  19. void Update () {
  20. if (flagvalue) {
  21. transform.Translate (Vector3.up * Time.deltaTime * speed);
  22. }
  23. if (gameObject.transform.position.y > 1) {
  24. gameObject.SetActive (false);
  25. }
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement