Search Unity

Manipulating velocity in update loop

Discussion in 'Editor & General Support' started by SuperVoximus, Aug 28, 2016.

  1. SuperVoximus

    SuperVoximus

    Joined:
    Nov 5, 2013
    Posts:
    102
    Hello, in my game, i launch an object at a certain angle and power after instantiating it using this:

    Code (JavaScript):
    1. clone.velocity = point.transform.forward * power * Upgrades.powerUpgrade * Time.deltaTime;
    I also have my object rotate based on the velocity using this :
    Code (JavaScript):
    1. transform.rotation = Quaternion.LookRotation(Ball.velocity);
    However, now I want to rotate my object mid air (as if it had airplane wings) and I want to change the velocity depending on that rotation change.

    I've tried adding and subtracting velocity.x and velocity.y but it's just terrible and not realistic at all.
    Can anyone help me out? I'm not sure what to do