If you want it to move with physics (forces) then you need to use forces to move it and not overwriting the data. Setting the object’s position manually isn’t giving any leeway to the physics engine- it’s literally saying “STAY THERE!”. Look into the Rigidbody functions for ways to move your object around, or just look around for tutorials on Rigidbodies and/or Physics.
You can remove the rigidbody from the object if you have a rigidbody on the things you want it to collide against- the point is that one of the two has to have a rigidbody or collision messages just won’t happen. That said, gravity won’t affect the character anymore without a rigidbody, and you’ll have to manually write the collision detection code to stop your character from passing through objects.
Do most people use rigidbody for their main character?
I don’t see how I can use user input to control the main character while refraining from setting rotation and location of the main character so that all the physics can be applied.
Most people use a rigidbody when they want things like gravity and such, yes. In general, pressing the “forward” button will apply a force to the object in that direction, while pressing left or right will rotate the object clockwise or counterclockwise while the button is held, but really you can do it however you want.
There are a million ways to write a character controller, of course, and the one that I’m using for my current project is a click-to-move one that I created from scratch myself, but even that uses the physics engine- but only for the “y” position mostly. You can still move a character around manually and benefit from gravity and such if you only allow the input to alter the X and Z positions while ignoring Y, so perhaps you should try that.
Try not to reinvent the wheel- there are dozens of great controllers out there already, and you can spend your time on things that are more specific to your game rather than going out of your way to make a new one.
Most character controllers don’t actually use force based physics. In most games the player expects more control then this give them.
You can set the ridgidbody up as kinematic and the colliders as trigger. This allows you to do all of the movement via code, but still let the engine detect collisions for you.
As to your original position, you can use physics and direct manipulation of an objects transform together just fine as long as you add to the position each frame, rather then setting it.
Yeah, mine apparently doesn’t use a rigidbody like I thought anyways- it uses the CharacterMotor script to simulate/recreate most of the same things, like gravity and collisions. Nearly two days now without sleep and I’m apparently not dealing with it very well, although to be fair I haven’t actually touched any of the low-level controller scripts in my game in well over a month now. My apologies, in any case.