Changing position.

With this code snippet, I want to translate my player object instead of copying it, but it doesn’t work, how should I do it?
I want the position to be like the copied objects here but to translate instead of copy.

+++++++++++++++++++++++++++++++++++++++++++

``````public void stairs()
{
Vector3 centerBottom = gameObject.transform.position;
float angleDegrees = 10f;
float angleRadians = angleDegrees * Mathf.PI / 180f;

Vector3 pos = new Vector3(centerBottom.x + x, stairsY, centerBottom.z + z);
Quaternion rot = new Quaternion();
GameObject step = Instantiate(stairsObj, pos, rot);
step.transform.Rotate(0, -i * angleDegrees, 0);
i++; stairsY += 0.1f;

//Player Move
/*playerMove.transform.Translate(0f, 0.1f, 0.1f);
playerMove.transform.rotation = Quaternion.Euler(0f, playerRotation, 0f);
playerRotation -= 10f;*/

//**In this part, I move the player.**
GameObject stepe = Instantiate(playerMove, pos, rot);
stepe.transform.Rotate(0, -i * angleDegrees, 0);

playerRotation -= 8f;

}
``````

+++++++++++++++++++++++++++++++++++++++++++++

You have commented out the code that translates the character (17-21) and are using Instantiate (line 22), which creates a new gameobject. Get rid of the instantiate and reinstate the transform.Translate.

Please don’t think me rude but do you really know what you’re doing? I strongly recommend that you go and do some basic Unity courses on learn.unity.com. This is an error that wouldn’t happen with even a basic level of Unity knowledge and/or C# coding. Perhaps you’re copying code that you don’t really understand…

I have a homework, but I couldn’t finish it, how do you think I should complete the code? It would be great if you could help me.