Hi All,
I am working on projectile motion. In that there is a button called throw. if i click throw button the ball object going projectile. In that i got maxheight. by using this code i am getting the height.
string height = GUI.TextField(new Rect(Screen.width-85, 10, 75, 25), (maxHeight).ToString());
if (maxHeight < (Projectile.transform.position.y - transform.position.y )){
maxHeight = ( Projectile.transform.position.y - transform.position.y );
}
After got max height i have a scale. I below of the scale there is sphere type of object. I want to pass that object into max height point.
i mean if i got maxHeight = 6.5 then that sphere i want to movie vertically same height.
for that i wrote code.
using UnityEngine;
using System.Collections;
public class Tran : MonoBehaviour {
public GameObject game;
void Start () {
}
void Update()
{
game.transform.Translate(game.transform.position.x,(game.transform.position.y+ThrowSimulation.maxHeight), game.transform.position.z);
}
}
But it is showing error. after playing my application that is automatically came into scenemode. If i write the custom method also not working properly.
And my task is when ever the throw is complete. i want to show my maxheight by using that sphere in that scale.
please help me
thanks in advance
Navadeep