Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Camera Perpetual Addforce?

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

  1. Jay2001

    Jay2001

    Joined:
    Dec 4, 2014
    Posts:
    18
    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.
     
    Jay2001 likes this.
  3. Jay2001

    Jay2001

    Joined:
    Dec 4, 2014
    Posts:
    18
    Thanks