void OnMouseEnter() {
Vector3 objectPos = transform.position;
Debug.Log(objectPos);
if(Input.GetKeyDown(KeyCode.Mouse0)){
Instantiate (_NONRIGIDCube,objectPos *1.05f,Quaternion.identity);
}
}
As you can see Ive had to *1.05f, this is not what I want however, I wish to only change the Y Value but keep the X,Z Position of the object. How would one go about doing this? Thank you
Vector3 newPosition = new Vector3(objectPos.x, objectPos.y * 1.05f, objectPos.z);
Instantiate (_NONRIGIDCube,newPosition,Quaternion.identity);