How do I invert the Y axis in Penelope tutorial?

How do I invert the y axis on the rotationJoystick for the camera in the Player Relative Control scheme?

I'm assuming you have to implement in the playerrelativecontrol.js script that when the joystick is +1 to be -1 and vice versa but I've tried several lines and nothing so far. If someone could help me i'd greatly appreciate it. It would save me $30 from buying the 3rd Person Camera Kit from unityprefabs.com.

Thanks.

go to edit ~> project settings ~> input and go down to the input which your script is using (joystick y?) and there is an option called invert, if you check that it should get the effect you want.

Probably too late to answer this question for you, but maybe it will help others like me who did a quick google search on the topic.

At the end of CameraRelativeControl.js

Change this:

// Rotate around the character horizontally in world, but use local space
// for vertical rotation
cameraPivot.Rotate( 0, camRotation.x, 0, Space.World );
cameraPivot.Rotate( camRotation.y, 0, 0 );

}

to this:

// Rotate around the character horizontally in world, but use local space
// for vertical rotation
cameraPivot.Rotate( 0, camRotation.x, 0, Space.World );
cameraPivot.Rotate( -camRotation.y, 0, 0 );

}

Voila.

if ( character.isGrounded )
{
    var camRotation = rotateJoystick.position;
    camRotation.x *= rotationSpeed.x;
    camRotation.y *= rotationSpeed.y;
    camRotation *= Time.deltaTime;

    thisTransform.Rotate( 0, camRotation.x, 0, Space.World );

    cameraPivot.Rotate( camRotation.y, 0, 0 );

}

This is the code that applies the camera rotation to the rotateJoystick which is my right joystick on screen. It's located in my Update Function in PlayerRelativeControl.js. The thisTransform.Rotate line rotates the character around world-y using the x axis of the Joystick.

I was thinking you could just add a simple if statement like:

if ( rotateJoystick.position.x > 0 )

rotateJoystick.position.x = 1;

but it definitely didn't work and I'm sure it's more complex then that.