コード例 #1
0
 public override void FixedUpdate()
 {
     if (IsPropeling && chargeLeft > 0)
     {
         OwnBody.AddForce(Vector3.up * power);
         chargeLeft -= Time.fixedDeltaTime;
     }
 }
コード例 #2
0
    void ProcessInput()
    {
        Vector3 force = Vector3.ProjectOnPlane(new Vector3(input.h, 0, input.v), Ground.Normal);

        force.Normalize();
        force *= power * input.speedRatio;

        Vector3 position = Parent.position + Parent.forward * 2;

        OwnBody.AddForceAtPosition(force, position);
    }