How to calculate something like
Vector3 NextPosition = Position / 1.1;
or
Vector3 NextPosition = Position * 0.99;
?
It don’t want to work. But i simply need for example:
- Position of object is (20,0,20)
- I need to get (19,0,19)
Is there a way to do this somehow?
is it because you forgot to add the F on your floats? so instead of Position / 1.1, it would be Position / 1.1F
float x = -1; //The x amount to add to the x axis.
float y = 0; //The y amount to add.
float z = -1; //The z amount to add.
//The above values are variable. You can delete these and set them in the inspector.
void Start(){
transform.position = new Vector3(transform.position.x + x,transform.position.y +y, transform.position.z + z);
}