A motionless object having multiple positions at the same time
Hello,
I'm trying to get the position of an empty object which is currently motionless but by putting this in Update() :
Debug.Log(bulletSpawn.position);
I can see in the Console this :
The blue one highlighted is the real position and the others below are nothing for me.
The different values are returned at the same time.
Hope you can help me.
It looks like you have your update happening on multiple game objects at the same time. If you take a look at the bottom of the console window it shows that you are calling this from a Gun$$anonymous$$anager class. Check the other positions in that list to see where they are co$$anonymous$$g from and make sure you are not calling that update from more than one place.
I solved it by removing the RigidBody on my player and just letting the Character Controller. Can't we use a Character Controller and a RigidBody at the same time ?
You can, you just need to set it to be a $$anonymous$$inematic RigidBody.
Answer by Ossi101 · Jul 20, 2019 at 10:27 PM
If you are using a Rigidbody with a Character Controller you need to set the BodyType to Kinematic.