- Home /
Question by
TheGabeMeister · Jan 13, 2013 at 05:57 PM ·
transformposition
How do I specificly change the Y co-ordinates of:
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
Comment
Best Answer
Answer by Lovrenc · Jan 13, 2013 at 05:59 PM
Vector3 newPosition = new Vector3(objectPos.x, objectPos.y * 1.05f, objectPos.z);
Instantiate (_NONRIGIDCube,newPosition,Quaternion.identity);
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
transform postion trigger problem HELP! 0 Answers
platforme ...HELP!! POSITION ADDING 1 Answer