First level

as soon as i hook up this code my ship go really close to the camera, i have been at it most of the dad now and i have had enough, i understand that its the local position to the parent but there is no way to move it as it just goes back to the same position. without the final like of code it is in the right plas on the screen

float xThrow = CrossPlatformInputManager.GetAxis(“Horizontal”); // assign the crossplatfomr input to the xThrow name.

    float xOffSet = xThrow * xSpeed * Time.deltaTime;// the offset 

is the xThrow times the xSpeed time time.deltatime.

    float rawNewXpos = transform.localPosition.x + xOffSet;

    

    transform.localPosition = new Vector3(rawNewXpos,transform.localPosition.y,transform.localPosition.y);

Hi Timothy,

The local “depth” axis is the y-axis. If rawNewXpos didn’t fix the issue for you, test the same approach with y.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms