- Home /
Fix Position of gameobject.
I am working on application where i want to change position of game object in x direction using local position.
here is my code
IEnumerator Load Product(string product, Game Object parent, Vector3 position, Vector3 rotation)
{
Game Object go = Instantiate (Resources.Load (product)) as Game Object;
go.tag = "application";
go.transform.parent =parent.transform;
go.transform.localPosition = new Vector3(0,0,0);
go.transform.localRotation =Quaternion.Euler(rotation);
currentProduct = parent;
}
StartCoroutine(LoadProduct(product, pokethru, new Vector3(0,0,0), new Vector3(-26, -44, 21)));
I want to change position of game object towards x axis.i have tried many things.but if I Change x axis only the game object will rotate .I want fix position of game object..
I am new for unity.any help will be appreciated.
Your answer
Follow this Question
Related Questions
Want to move 2d fish sprites in pond ! 0 Answers
Distribute terrain in zones 3 Answers
How to store a gameobject in a variable 1 Answer
Multiple Cars not working 1 Answer