I am currently working on a movable camera for my character and I have this script so far but i cannot get it to work. I will try to get it work over the next few days;
function Start () { var angles = transform.eulerAngles; x = angles.y; y = angles.x;
// Make the rigid body not change rotation if (rigidbody) rigidbody.freezeRotation = true; }
function LateUpdate () {
if (target) { if (Input.GetMouseButton(0)) { x += Input.GetAxis("Mouse X") * xSpeed * 0.02; y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02; var test = 0; test = y; } distance += -(Input.GetAxis("Mouse ScrollWheel") * Time.deltaTime) * zoomRate * Mathf.Abs(distance); if (distance < 2.5) { distance = 2.5; } if (distance > 20) { distance = 20; }
y = ClampAngle(y, yMinLimit, yMaxLimit);
//Debug.Log("y: "+y+" test: "+test);
if( y == yMinLimit && test == yMinLimit) { // This is to allow the camera to slide across the bottom if the player is too low in the y distance += -(Input.GetAxis("Mouse Y") * Time.deltaTime) * 10 * Mathf.Abs(distance); }
var rotation = Quaternion.Euler(y, x, 0); var position = rotation * Vector3(0.0, 2.0, -distance) + target.position;
I have come to the horrible conclusion that I cannot figure how to get my character to jump :(, I have tried multiple scripts with multiple variations of those scripts, for example;
private var walkSpeed : float = 1.0; private var gravity = 100.0; private var moveDirection : Vector3 = Vector3.zero; private var charController : CharacterController;
function Start() { charController = GetComponent(CharacterController); animation.wrapMode = WrapMode.Loop; }
// Create an animation cycle for when the character is turning on the spot if(Input.GetAxis("Horizontal") && !Input.GetAxis("Vertical")) { animation.CrossFade("walk"); }
transform.eulerAngles.y += Input.GetAxis("Horizontal"); // Calculate the movement direction (forward motion) moveDirection = Vector3(0,0, Input.GetAxis("Vertical")); moveDirection = transform.TransformDirection(moveDirection);
My name is Steve Paul Myers and I studied Interactive Media Design at Northumbria University and graduated in July 2011.
I am an illustrator, interactive media designer and web designer. I wrote my dissertation - From Comic Books to Graphic Novels: The births, origins and the revolution they caused. An Investigation and Discussion and it was about the evolution of the comic book and I’m in the process of getting it published.
I have been drawn (excuse the pun) to art and design long before university and I have been posting on DeviantArt for years. I have created several infographics and I have panache for social media.
I am also very fond of character design. I created a mascot and logo called Dimitri for my portfolio site, and then developed Dimitri further by creating a video game based on him.
My other passions are cooking, movies and music.
I currently live in Newcastle upon Tyne in the North East of England with my beautiful girlfriend, two cats and a monkey who steals my socks…
If you are interested in commissioning me for any illustration work please email me at hello@stevepaulmyers.co.uk.