Hello. Everytime I try to rotate my object using my code, it offsets the x rotation to 0 again. I think it has something to do with me defining my rotation when I instantiate the object, but I’m not sure. Here is my code:
if (!ghostOn)
{
ghost = (GameObject)Instantiate(Building[SelectedBuilding],
new Vector3(hit_.point.x - hit*.point.x/2,*_
_ hit*.point.y + (Building[SelectedBuilding].transform.localScale.y / 2),
hit.point.z - hit.point.z/2),
Quaternion.Euler (-90, 0, 0));*_
* ghostOn = true;*
* }*
* if (ghostOn && Input.GetKeyDown (KeyCode.R)) {*
* ghost.transform.rotation = Quaternion.Euler(ghost.transform.rotation.x, ghost.transform.rotation.y + 90, ghost.transform.rotation.z);*
* }*