- Home /
Moving a camera with AddFoce, or setting velocity, need help
This seems like the kind of thing I should be able to quickly find a reference or tutorial for, but the keywords just don't seem to lead me to anything.
So, here is my workflow:
Character Control Script
^A method called from LateUpdate to control the camera
^This method basically takes the code from "Mouse orbit improved" to orbit an empty gameobject around the player, with the mouse
^This method then uses physics to push the camera towards this orbited position.
cameraRigidbody.velocity = ((direction) * (Mathf.Abs (Vector3.Distance ((the world position of my orbited object), (the current world position of the camera)))*200f) * (Time.smoothDeltaTime));
This was working very well but it's too shaky and inconsistent to stick with.
Please someone, what is the ideal way to move a camera with physics, PREFERABLY keeping true to the current order of operations (in that, we use one object for "where it should be" and use physics to move it towards that object")
Answer by sh_code · Jan 13, 2019 at 10:49 PM
don't make camera a physics object. remove its rigidbody, and modify its transform directly.
Your answer
Follow this Question
Related Questions
Stopping a rigidbody immediately 2 Answers
different beetween transform.translat and rigidbody.addforce? 1 Answer
Rigidbody Addforce cancels out Rigidbody velocity..maybe? 0 Answers
Why can't I get AddForce or Velocity work? 2 Answers
How to make a ball stay in the air longer when force is added? 1 Answer