i have a character controller that isn’t a rigidbody. none of my scripts adds the rigidbody component to my player, but if i hit play in the editor or build my project unity auto adds the rigidbody to it and it messes the player up. if its in the editor before i hit play and usually anything changed manually in the scene resets after you stop play mode. but the rigidbody stays on the character prefab after. i have saved the prefab into a prefab folder and even that is effected. even though its not in the scene. no matter how many times i remove the rigidbody on play its added again. ive even went through and disabled anything that could be doing it one at a time and still no luck. closing unity and reopening doesn’t fix it either. please give me some help in solving this. im also using the mirror network package. but i didn’t have this problem in the beginning. it just started happening.
ok i have an update. im sure its some bug on unitys end. ive just enabled unitys urp and now it no longer adds the rigidbody to my player if i build or play in editor, as long as i dont touch anything on it though. if i change some variable or add a component or script unity adds it again, including the prefab in the assets. ive gone through every script that the player uses and every call to every script in each and none of them require, call, or use a rigidbody in anyway. im stumped. i dont want to have to redo my player from scratch, hes almost complete and has a lot of scripts and variables attatched to him.
Sounds like one of your scripts probably has a RequireComponent line on it. That will automatically add the component if it is missing. You should be able to search your project for the line and remove it.
It is happened to me as well. If you attach a script with the name of PlayerController, change it to another name. There are some scripts with the name of PlayerController on the MirrorExample that require CharacterController and Rigidbody, idk somehow the script clashes.,It is happened to me as well. If you attach a script with the name PlayerController, change it to another name. There are some scripts with the name of PlayerController on the MirrorExample that require CharacterController and Rigidbody, idk somehow the script clashes.