Up and down is all the y-axis. X will move it sideways, z will move it forward and back.
Hmmm… I wonder if using Vector 3 and variables on the camera would get it to move… (not sarcastic)
Here is what I’m getting at:
using UnityEngine;
using System.Collections;
public class InsertNameHere : MonoBehaviour {
public float speed = -6f;
Vector3 movement;
void Awake (){
}
void update (){
float up = Input.GetKey (KeyCode.Space);
float LAndR = Input.GetAxis ("Horizontal");
float FAndB = Input.GetAxis ("Vertical");
Cameramovement (LAndR, up, FAndB);
}
void Cameramovement (float LAndR, float up, float FAndB){
movement.Set (LAndR, up, FAndB);
movement = movement.normalized * speed * Time.deltaTime;
playerRigidbody.MovePosition (transform.position + movement);}
This is all in C#, and I am not 100% positive that this will fix your problem, but try it.
Just copy and paste this into a new C# script, and change “InsertNameHere” To your script’s name. Remember, no spaces on the script name!