Quantcast
Channel: Answers by "shriya"
Viewing all articles
Browse latest Browse all 98

Answer by shriya

$
0
0
You have assigned x y z value equal to 0 and you have not applied any change to it. In Update you are Continuously passing (0,0,0). Your code works but since the value doesnot change ,you dont see any change. using UnityEngine; using System.Collections; public class Demo : MonoBehaviour { public float x ; public float y ; public float z ; // Use this for initialization void Start () { x=0f; y=0f; z=0f; } // Update is called once per frame void Update () { x += 1; transform.position = new Vector3(x,y,z); } } Now u will see it changing position.

Viewing all articles
Browse latest Browse all 98

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>