Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Camera Perpetual Addforce?

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

  1. Jay2001

    Jay2001

    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.
     
    Jay2001 likes this.
  3. Jay2001

    Jay2001

    Joined:
    Dec 4, 2014
    Posts:
    19
    Thanks