- Home /
Question by
rd42 · Apr 29, 2010 at 10:49 PM ·
iphonecoordinates
Coordinate confusion
I attached the following script to a ball. When I run the script, it always launches towards the camera. Why is that?
and how often does function update() cycle? Once a second?
var time = 0; var x =0; var y =0; var velx = 4; var vely = 300;
function Update () {
time++; x = velx time; y = vely time - 0.5*9.8*time*time; transform.position = Vector3(0,y,x); }
Comment
Best Answer
Answer by Eric5h5 · Apr 29, 2010 at 11:55 PM
Update runs every frame. This makes your code framerate-dependent; use Time.deltaTime to fix that. The ball is only doing what you to told it to do...I'm not sure what your intentions were.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How to Use Activity Indicator in Unity3d 1 Answer
Unity iPhone Tutorial? 1 Answer