Hi,
Help me with advice! What’s the method can be applied to the object with smooth movement on an ice (similar to a puck)? I already tried to use Vector3.Lerp but there no smoothness. Plus at high speed of object the function OnCollisionEnter() is doesn’t work - the object transits through walls (colliders).
function StartMove () {
t = 0.0;
while (t < 1.0) {
curSpeed = startSpeed - (startSpeed * t);
t += Time.deltaTime * curSpeed;
enemyBaseTransform.position = Vector3.Lerp(StartPoint.position, FinalPoint.position, t);
yield;
}
}
Can be to use Physic with FixedUpdate()?
Thanx.
It is probably best to handle the puck with the physics engine. The problem with a fast-moving object passing through colliders can usually be fixed by setting the rigidbody’s collision detection to Continuous Dynamic.
I have Unity iPhone 1.7 and there isn’t Continuous Dynamic (Rigidbody.collisionDetectionMode)…
In that case, you can try decreasing the physics time step with the Time.fixedDeltaTime property and decreasing the Minimum Penetration For Penalty value in the physics settings (menu: Edit > Player Settings > Physics). There is also a useful script called DontGoThroughThings on the Unify wiki that uses a raycast to detect when an object would pass through a collider and stop it from happening.