Tu cherches bien compliqué pour un début je trouve

Ceci dit, regarde du coté des Physic Material, cela te fournira un début de piste.
Modérateur : Administrateurs Suppléants
Tu cherches bien compliqué pour un début je trouve
Code : Tout sélectionner
public Vector3 contrainteVelocity;
public Vector3 contrainteAngle;
if (contrainteOn)
{
contrainteVelocity = Vector3.Lerp(contrainteVelocity,Vector3.zero , 0.005f);
contrainteAngle = Vector3.Lerp(contrainteAngle, Vector3.zero, 0.005f);
RB.velocity = contrainteVelocity;
RB.angularVelocity = contrainteAngle;
if (RB.velocity == Vector3.zero && RB.angularVelocity == Vector3.zero) { vaissInfo.contrainteOn = false; }
}