- Home /
camera movements very slow, why!? :)
Hello, Unityrs,
I am working in writing down very simple script for very basic functionalities. Just to learn Unity. So, now I am committed to understand why my camera/carachterController movements are that slow. I created a prefab and attached a cylinder representing my character, then I attached a characterController component to the prefab and I wrote the following script attached to the prefab. But the movements are very slow..., THANK for any help/suggestion.
private var controller :CharacterController; controller = gameObject.GetComponent(CharacterController);
private var moveDirection = Vector3.zero; private var forward = Vector3.zero; private var right = Vector3.zero; var speed = 0.30;
function Update() { / var x = Input.GetAxis("Horizontal") Time.deltaTime speed; var z = Input.GetAxis("Vertical") Time.deltaTime speed; transform.Translate(x, 0, z); /
forward = transform.forward; right = Vector3(forward.z, 0, -forward.x);
var horizontalInput = Input.GetAxisRaw("Horizontal"); var verticalInput = Input.GetAxisRaw("Vertical"); var targetDirection = horizontalInput * right + verticalInput * forward;
moveDirection = Vector3.RotateTowards(moveDirection, targetDirection, 200 Mathf.Deg2Rad Time.deltaTime, 1000);
var movement = moveDirection Time.deltaTime 2; controller.Move(movement);
}
i assume the 2 near the end is the speed, why not just make it public and test some higher values?
Answer by Mike 3 · Aug 27, 2010 at 12:14 PM
First, try changing the speed value from the inspector
Secondly, it could be possible that you're colliding with the cylinder - try setting the cylinder's collider to be a trigger, or remove the collider entirely
Colliding with another object?... possible but checking the x,y,z coordinates they were increased very little... likely is the speed value. I'll check that out. many thanks!
Answer by kami1339 · Jan 25, 2019 at 12:46 PM
No ! 1You cant choose obj file because unity will very slow camera and etc convert them for example with iClone 3DXchange v7.01 Pipeline! 2You must acclusion your camera ! 3Chage size your texture with Advanced JPEG Compressor. 4Change your build setting like my picture.
Your came wil be high speed.
Your answer
Follow this Question
Related Questions
Player inversed inputs 0 Answers
How can i make my simple character controller rotate? 0 Answers
New input system controller stops detecting on fully pressed trigger? 0 Answers
Collision With Character Controller 4 Answers
I need mouse look and CharacterController.Move to work on the same object 1 Answer