Single joystick with slide control - quick question

Hey guys I’m working on a little project for class and what I’m trying to do is recreate a control scheme like NOVA or other iphone fps games…I want to slide one finger anywhere to look around and have a single joystick for movement. I’ve got it to work, but the finger controlling the movement joystick is also moving the camera. Is there a way to separate these out? My character has a character controller, a mouselook script, and a movement script I modified to work with one joystick.

@script RequireComponent( CharacterController )

var moveJoystick : Joystick;
				
var forwardSpeed : float = 4;
var backwardSpeed : float = 1;
var sidestepSpeed : float = 1;
var jumpSpeed : float = 8;
var inAirMultiplier : float = 0.25;					// Limiter for ground speed while jumping

private var thisTransform : Transform;
private var character : CharacterController;
private var velocity : Vector3;						// Used for continuing momentum while in air

function Start()
{
	// Cache component lookup at startup instead of doing this every frame		
	thisTransform = GetComponent( Transform );
	character = GetComponent( CharacterController );	

}

function OnEndGame()
{
	// Disable joystick when the game ends	
	moveJoystick.Disable();

	// Don't allow any more control changes when the game ends
	this.enabled = false;
}

function Update()
{
	var movement = thisTransform.TransformDirection( Vector3( moveJoystick.position.x, 0, moveJoystick.position.y ) );

	// We only want horizontal movement
	movement.y = 0;
	movement.Normalize();

	// Apply movement from move joystick
	var absJoyPos = Vector2( Mathf.Abs( moveJoystick.position.x ), Mathf.Abs( moveJoystick.position.y ) );	
	if ( absJoyPos.y > absJoyPos.x )
	{
		if ( moveJoystick.position.y > 0 )
			movement *= forwardSpeed * absJoyPos.y;
		else
		{
			movement *= backwardSpeed * absJoyPos.y;
		}
	}
	else
	{
		movement *= sidestepSpeed * absJoyPos.x;
		
		// Let's move the camera a bit, so the character isn't stuck under our thumb
	}
	
	// Check for jump
	if ( character.isGrounded )
	{
		if ( moveJoystick.tapCount == 2 )
		{
			// Apply the current movement to launch velocity		
			velocity = character.velocity;
			velocity.y = jumpSpeed;			
		}
	}
	else
	{			
		// Apply gravity to our velocity to diminish it over time
		velocity.y += Physics.gravity.y * Time.deltaTime;
		
		
		// Adjust additional movement while in-air
		movement.x *= inAirMultiplier;
		movement.z *= inAirMultiplier;
	}
		
	movement += velocity;	
	movement += Physics.gravity;
	movement *= Time.deltaTime;
	
	// Actually move the character	
	character.Move( movement );
	
	if ( character.isGrounded ) {
		// Remove any persistent velocity after landing	
		velocity = Vector3.zero;
	}
}

I think the easiest way to do that would be to figure out if the touch is inside the joysticks rect. If it is do not use that touch for rotating.

okay so on my mouselook script have it check to see if the touch is outside of the rect, and if it is rotate if its not, do nothing, right?

I cant seem to figure this out for the life of me. They conflict too much…its almost like mouselook isnt suitable for the touchscreen.

I think you´ll have to remove the camera control from the joystick movement and try to create an invisible GameObject ( could be a sphere ) and put a 2D ( only on x and y axis ) touch follow movement on it and on the camera you could try using the smoothfollow2d script and make your target that GameObject created.You could also leave the camera on the joystick when the character is moving and change the camera view to the invisible GameObject when your character has stopped moving, so your players could change only the camera angle!