Penelope Script [Solved]

I am trying to adapt the penelope script to some things that I want to do. This part of the script confuses me though, for Camera Relative:

// This script must be attached to a GameObject that has a CharacterController
@script RequireComponent( CharacterController )

var moveJoystick : Joystick;
var rotateJoystick : Joystick;

var cameraPivot : Transform;						// The transform used for camera rotation
var cameraTransform : Transform;					// The actual transform of the camera

what exactly is the Joystick in moveJoystick and RotateJoystick variables referencing? I would think its the joystick script but referencing my own similar script gives an error…

It is a variable which will store a reference to an instance of the Joystick class.

I’m dumb when it comes to scripting, so what exactly is the Joystick class (btw what’s a class? Is it somewhere in a script?) :-/

That’s a little too complicated to just explain in a forum post. I suggest you read some beginner C# or OOP tutorials.

ignore what I asked about classes burnt where is the Joystick class the script is referencing since that’s what’s confusing me. I even copied the whole script into my project and I’m getting the same error.

I’m not sure since I never used it, but I think the Joystick class is in the standard bundle somewhere.

What error are you getting?

Been a while since I looked at this project but on quick glance it refers to joystick.js which you will find in your Project Pane.

iirc the camera moves relative (hence the name) to the joystick movement and the character moves based on the camera (not the joystick). As I say its some time since I really looked at it but that’s what I remember at the time.

If you are struggling with this I would follow Smag’s advice given earlier.

This is what I was actually looking for, if its trying to access the script…

Watch this vid of my control gui:
http://www.screencast.com/t/YmE3MzQzMTgt

Im basically trying to adapt the script from the penelope demo to work with my arrow control system so the character moves in the direction the arrow is pointing. But I dont understand where in the penelope script the guis position is being used to move the character.

In you Project pane open up Control Setups and double-click on the CameraRelativeSetup. In the Hierarchy Pane you will see a Player GO. Single-click on this and over in the Inspector pane you will see the CameraRelativeControl component (script). You will see this is where the joysticks are assigned (dragged into the member variables). Click on one of these and you will see the Joystick GO in the Hierarchy pane named leftPad and rightPad.

In CameraRelativeControl the characterController (named character) is moved based on the moveJoystick and the camera is rotated based on the rotateJoystick.

I just noticed that the joystick it is actually referencing is the gui joystick objects.

Well, I solved this by scripting my own way of controlling the character anyways, thanks.