Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Camera Perpetual Addforce?

Discussion in 'Physics' started by WintermuteDigital, Jan 18, 2015.

  1. WintermuteDigital

    WintermuteDigital

    Joined:
    Dec 4, 2014
    Posts:
    19
    So, I'm making a Flower-esque game, and if any of you guys have played it, the camera always is moving forwards in the direction your dualshock is pointing. How can I make the camera always move in a straight line in the direction my mouse is pointing? (I've already got a mouselook script).
    Thanks!
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    If you want the camera to move precisely in the direction the camera is looking (ie, without the lag or drifting you might get from a real object) then you probably don't want to use the physics engine to implement it. You just need to use transform.Translate to move the camera each frame. There is a code sample on the script ref page for this function that shows how to do move in an object's forward direction.
     
    WintermuteDigital likes this.
  3. WintermuteDigital

    WintermuteDigital

    Joined:
    Dec 4, 2014
    Posts:
    19