Hi,
In a very basic setup (1 terrain 512x512 with 2 textures, 5 3ds-based low poly building models, 1 directional light, 1 3ds-based tank model) the editor crashes freezes randomly and never comes back. Sometimes it freezes when putting a new 3d model onto the terrain, but in 95% of the freezes, it happens when playing the game in the game view. The triangle count isn’t that high, not very much draw calls. No sound effects or whatsoever. Shadows are enabled through pixel shader.
The tank has 3 physics boxes and a self written, very simple script attached to it:
var forwardSpeed = 6.0;
var gravity = 20.0;
var rotationSpeed = 90.0;
var tower : Transform;
var barrel : Transform;
var barrelMaxUpAngle = 60.0;
var barrelMaxDownAngle = 30.0;
private var moveDirection = Vector3.zero;
private var grounded : boolean = false;
private var xAxis = 0.0;
private var yAxis = 0.0;
private var mouseX = 0.0;
private var mouseY = 0.0;
private var deltaRotation;
private var barrelCurrentAngle = 0.0;
function FixedUpdate() {
xAxis = Input.GetAxis("Horizontal") * rotationSpeed * Time.deltaTime;
yAxis = Input.GetAxis("Vertical");
mouseX = Input.GetAxis("Mouse X") * rotationSpeed * Time.deltaTime;
mouseY = Input.GetAxis("Mouse Y") * rotationSpeed * Time.deltaTime;
var body : Rigidbody = GetComponent(Rigidbody);
// We are grounded, so recalculate movedirection directly from axes
moveDirection = new Vector3(0, 0, yAxis);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= forwardSpeed;
// Apply gravity
moveDirection.y -= gravity * Time.deltaTime;
// Move the controller
body.MovePosition(body.position + moveDirection * Time.deltaTime);
deltaRotation = Quaternion.Euler(Vector3(0,xAxis, 0) );
body.MoveRotation(body.rotation * deltaRotation);
deltaRotation = Quaternion.Euler(Vector3(0,mouseX, 0) );
tower.rotation = tower.rotation*deltaRotation;
barrelCurrentAngle -= mouseY;
if ( barrelCurrentAngle < -barrelMaxUpAngle ) {
barrelCurrentAngle = -barrelMaxUpAngle;
}
if ( barrelCurrentAngle > barrelMaxDownAngle ) {
barrelCurrentAngle = barrelMaxDownAngle;
}
barrel.rotation = tower.rotation*Quaternion.Euler(Vector3(barrelCurrentAngle,0, 0) );
}
This is the only script I wrote and attached to the scene.
Does anyone encounter a similar freezing error? It’s quite annoying because it happens like once or twice every 20 minutes…
I don’t think that my machine is the cause but you never know:
Win7 Ultimate 64bit
Q9550
8 GB RAM
HD5870 based GFX-card
Hoping for help…