- Home /
Help: My fall speed is strange
Hey guys, me again. I have a Blender generated terrain and I have a plank generated by unity. Whenever I walk off the plank I instantly hit the ground. My gravity does not take effect. Here is my code:
using UnityEngine;
using System.Collections;
public class CC : MonoBehaviour {
public float movementSpeed = 5.0f;
public float rotateSpeed = 5.0f;
public float jumpSpeed = 20.0f;
public float sprintSpeed = 8.0f;
float verticalRotation = 0;
public float updownRange = 60.0f;
float verticalVelocity = 0;
// Use this for initialization
void Start () {
Screen.lockCursor = true;
}
// Update is called once per frame
void Update () {
CharacterController cc = GetComponent<CharacterController>();
//rotation
float rotLeftRight = Input.GetAxis("Mouse X") * rotateSpeed;
transform.Rotate(0, rotLeftRight, 0);
verticalRotation -= Input.GetAxis("Mouse Y") * rotateSpeed;
verticalRotation = Mathf.Clamp( verticalRotation, -updownRange, updownRange);
Camera.main.transform.localRotation = Quaternion.Euler( verticalRotation, 0, 0);
float forwardSpeed = Input.GetAxis("Vertical") * movementSpeed;
float sideSpeed = Input.GetAxis("Horizontal") * movementSpeed;
verticalVelocity += Physics.gravity.y * Time.deltaTime;
Vector3 speed = new Vector3( sideSpeed, verticalVelocity, forwardSpeed );
speed = transform.rotation * speed;
cc.Move( speed * Time.deltaTime );
}
}
Sorry i keep bugging you all im a noob. D:
Everything is scaled too small. Check the import tab for your level and change the scale from 0.01 to 1, then scale everything else accordingly, via their own import tabs.
This looks exactly like my script. Listen, I don't appreciate you using my script like that. I wrote this code from the ground up and all you did was change the variable names and claim it as your own. I told you how to fix your problem and this just makes me beyond mad and pissed off. Don't bother emailing me again and I will have this taken down.
I'm really sorry. I found this on a youtube video. It was by Quill18Creates. I didn't mean to take your script. I never knew it was yours and I was just trying to learn. I'm really sorry. I'll take it down if you want.
Uh no it is not some script on youtube. It's $$anonymous$$e. You were on the collab forum, you probably made a new account. We emailed each other like 100 times back and forth and I sent you my script. $$anonymous$$y script wasnt taken from some video, as it was handcrafted from me. You want me to post the original script or what? You wanna see how CLOSE it is to $$anonymous$$es? Huh? Take it down and never, ever lie to me like that and just run off with my script like that
@$$anonymous$$rProfessorTroll: Hey man relax, the script is indeed copied from quil18, see for yourself (Fps tutorial, download and see the code) - it's a literal copy (yes, with a change of variable names)
If that is indeed your script, then I guess you'd have settle this with Quil himself. - It's not very nice to jump and throw false acquisitions to people like that. You should have asked him first where he got it from, and after you see his source, only then decide. Not to mention this FPS thing is very well known, there's a high chance that scripts could look very similar to each other.
And @FireHawk33 always mention where you got your scripts from in your question.
Your answer
![](https://koobas.hobune.stream/wayback/20220613115753im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Problem with boxcollider. Fall z=-100000 0 Answers
Make block raise and lower based on timer 1 Answer
Falling Tiles 1 Answer
How do I make my FPS not fall throgh the terrain? 1 Answer
Life calculator 0 Answers