When my player goes onto some curved part of a mesh/model, it falls. Here is a part of the model rendered in SketchUp;
At the start/bottom of the loop, the player suddenly falls. The same thing happens to other models.
The mesh is a whole model that has a mesh collider. Straight surfaces seem to work but any surface which is in a different angle doesn’t work.
The player is a mesh with a box collider. It is controlled by the script used here ( Scripting: Unity 3D Tutorial (Part 5) - YouTube ).
I’ve edited it but I think they’re non-obtrusive additions.
// JavaScript Document
#pragma strict
var forwardRate : float = 3;
var turnRate : float = 2;
public var idleAnimation : AnimationClip;
public var walkAnimation : AnimationClip;
public var runAnimation : AnimationClip;
public var jumpPoseAnimation : AnimationClip;
function Update () {
Speedy();
}
function Speedy() {
// tank's forward speed in action
var forwardMoveAmount = Input.GetAxis("Vertical") * forwardRate;
// force of the tank's turn
var turnForce = Input.GetAxis("Horizontal") * turnRate;
// rotate tank in action
transform.Rotate(0,turnForce,0);
transform.position += transform.forward * forwardMoveAmount * Time.deltaTime;
if (Input.GetAxis("Vertical") > 0.2)
animation.CrossFade (runAnimation.name);
else
animation.CrossFade (idleAnimation.name);
}
I’d be so grateful for anybody who finds an answer.