Why use physics engine to move things around game?

Hello everyone, I am new here and I have a question on how best to move a character around the game. This question is more of a general one, I don’t have any specific game or code that I need help with. Anyway I was watching some unity tutorials and I noticed that in all the examples(from what I watch anyway) the movement is through the physics engine. Instead of something like “GameObject.Transform.x += 1” (for the sake of the question, assume that that would actually work). Why are things like “rb.position = new Vector3(x,y,z)” used to move a game object vs just updating the game object’s actual x value? And is there ever a time in which it would be wise to directly update an x, y, z value vs using a command like “rb.position = new Vector3(x,y,z)”?

The response is in your question, when you move your object with physics, your rigidbody has a Velocity and many other physical parameters, when you use rb.position = new Vector, you just teleport the object, and not using the physics at all.

You can update the position manually if you don’t want to use the physic.

Ok thanks, but is there any difference/drawback to teleporting the object by changing the rigid body parameters vs just manually updating the position, Or is it more just a personal preference on how one moves a game object?

If you want to take a single object and move it smoothly from Spot A to Spot B each frame using a coRoutine and manually manipulating the position, thats pretty easy and probably no need to bother with the physics engine.

If you have 30 (or 300!) objects flying around with their own velocities, gravity, collisions , friction then there is probably no need to reinvent the wheel and just use the built in physics engine. You could assign some constants (gravity, friction, intitial velocities) and just let the physics engine take over. Then you just need to make minor adjustments as the user has inputs (like firing jets).

Drawback with physx are performances and unpredictability, if you move 1000s of characters you’ll feel the sting.
Like CrymX says it’s a matter of play style : if you want RPG character and no physics then navmeshagent is ok, if you want a hack and slash the character controller is ok, if you want goat sim, physix will make youtube laugh.
Performances: character controller ~ physics controller ~ anything with a collider >> navmesh agent > transform.position